Comments (4)
I never properly addressed this issue. Some background: I originally started on Lucy a couple of years ago and tagged template literals is how it originally worked. You can see the original version here: https://github.com/matthewp/lucy/blob/main/packages/xstate/test/guard-test.js#L10
For various reasons I put the project aside until I started it back up recently. I decided it was best to define the language as a standalone thing first. Recently I've been more interested in trying out a tagged template approach again. It wouldn't work with things like use
but for the most part the new language should work well. The question is can it be done in a small package. The current compiler wouldn't work of course, it would need to be a new JS based parser / compiler.
That is to say I'm interested to try and work on this, but it won't be for at least a little while until the TS support and various tooling is more mature. Then I might come back around to this idea as I do think there is a segment of people who would be more likely to use Lucy if they didn't need to use a separate language file and associated tooling.
from liblucy.
A parse function would also be excellent:
import { parseToJson } from '@lucylang/node';
const machine = parseToJson(
`
// Lucy file in here
`
)
from liblucy.
@mattpocock is this meant to return an AST? Or is this the JSON representation from the other issue?
from liblucy.
@matthewp Probably the same JSON representation from the other issue. Though I'd assume we'd add methods for the raw parsing to JS, too.
from liblucy.
Related Issues (20)
- Allow comments HOT 1
- Allow for stopping spawned actors HOT 5
- Guards for immediate transitions HOT 1
- Allow for unimplemented actions/services/guards HOT 13
- Change the generated code to export a function, not a static machine definition HOT 18
- Add option for outputting to JSON HOT 4
- Add node/browser lib for Lucy HOT 2
- Incorrect indentation when a reference follows an inline assign
- Named actions/guards get shared with sibling machines
- [IDEA] XState JSON to Lucy? HOT 8
- Parallel states
- Nested states without nested machines HOT 2
- Compile hangs if too many repeated event definitions HOT 1
- Actions in nested machines HOT 2
- Target a nested state with an event HOT 2
- spawning should be done with a callback
- dts not created for entry actions
- Sending to an actor should include parent event data
- Invoking "use reference" is incorrectly referenced in services property HOT 2
- Why not javascript? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liblucy.