Comments (8)
Hi @mattpocock!!
Yes, for mi this is zero urgent, but an idea for the future. Would be an addition to the command line, that passing a JSON generates a Lucy code. I see a bright future for Lucy together with XState and I think it can be a useful thing to have in the future, but zero urgent for now :)
from liblucy.
@matthewp Not yet, but this is in the works. I do think that it'll be very similar to, or interoperable with, the machine config structure that we currently pass into XState's createMachine
.
from liblucy.
Yes!! I think it would be the object we pass to createMachine
serialized. For reference, I see in this comment https://spectrum.chat/statecharts/general/how-to-serialize-a-machine-as-visualizable-json~94a8470a-c28d-4103-8137-9c8b081d9225 David explained how to serialize a XState machine.
from liblucy.
I asked about this idea here: statelyai/xstate#293. If there's a better issue to track please share.
from liblucy.
This would also be a great idea for demonstrating the value proposition of Lucy (as it should really shine for more complex examples). I was searching for an online XState to Lucy translator as I wanted to see how https://codesandbox.io/s/xstate-todomvc-33wr94qv1?file=/todoMachine.js would look in Lucy.
from liblucy.
Hey @santicros!
What's the use case here? Is this kind of like a codemod? I.e. take your existing machines and spit them out into Lucy? Wondering where we should prioritise this in terms of urgency.
from liblucy.
Thanks! So what I see a need for is:
- Convert Lucy to JSON.
- Convert JSON to Lucy.
I'm fully in favor of that. However, how will the JSON be used practically? If the visualizer had a JSON format that it could consume and produce that would make sense. You could build your machine in the visualizer, export as JSON, then convert to Lucy.
Does XState have such a format that it uses in the visualizer (or by any other tools)? This is where I want to hold off on this idea, until there's other tools using the JSON format (as a sort of intermediary) then I'm not sure what it's for in practice.
from liblucy.
Cool, is there a tracking issue for this?
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
- 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.