Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
davidkpiano
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
davidkpiano
5y ago
Stately.ai (REMOTE) At Stately, we want to make app and business logic accessible to the entire team and eliminate barriers between development, design, and product to make it easier to build and maintain complex applications quickly and ro
32.
▲
by
davidkpiano
5y ago
1. XState is open-source and MIT-licensed: https://github.com/statelyai/xstate , as well as the extension https://github.com/statelyai/xstate-vscode and various other tooling. The editor is closed-
33.
▲
by
davidkpiano
5y ago
Hello everyone - David (creator of XState) from Stately here! Excited (also anxious) to see this on Hacker News. Please keep in mind that it is a public beta: we have many features and improvements planned. If you have any suggestions, comm
34.
▲
by
davidkpiano
5y ago
State machines
35.
▲
by
davidkpiano
5y ago
Okay, now put boxes around each sentence and connect them with arrows. ;-) Imperative code quickly devolves to a point where it is no longer understandable by anyone but the developers who wrote it.
36.
▲
by
davidkpiano
5y ago
I'm planning on replacing the TodoMVC example and use a more real-world example. However, Kent is only using XState in one non-trivial interactive part of the site – the call recorder: https://github.com/kentcdodds/
37.
▲
Chromium plans to remove alert(), confirm(), prompt()
(groups.google.com)
4 points
by
davidkpiano
5y ago
|
1 comments
38.
▲
by
davidkpiano
5y ago
Sure; this isn't directed at step functions, but in general, if you have your business logic (state machine) in a declarative format, albeit non-programming language (e.g., JSON), then that can potentially make it even more testable
39.
▲
by
davidkpiano
5y ago
If the term "finite-state machine" were used instead, there would inevitably be people making comments like you, but instead complaining "this isn't finite, you have extra data in the machine that can be infinite".
40.
▲
by
davidkpiano
5y ago
Yes, you can. The vast majority of developers don't. That's the difference: enforcement.
41.
▲
by
davidkpiano
5y ago
Sorry if I was flippant. Here is an example of a minute timer app, which replicates Android's timer app behavior using statecharts: https://codesandbox.io/s/xstate-vue-minute-timer-viz-1txmk Allow popups to see a
42.
▲
by
davidkpiano
5y ago
Nobody's forcing you to use this library. Please take your negativity elsewhere. EDIT: Okay, didn't mean to interpret criticism as negativity; I apologize.
43.
▲
by
davidkpiano
5y ago
Lots of good examples here: https://xstate-catalogue.com/ It seems like you're just unfamiliar with state machines. They're not a "new, weird abstraction", they're a core concept of computer science
44.
▲
by
davidkpiano
5y ago
We're constantly working on improving the TypeScript experience with XState; there are some new things like `createModel()` that might help!
45.
▲
by
davidkpiano
5y ago
I built XState because I wanted a way for developers to integrate state machines & statecharts into web applications in a way that could be automatically visualized: https://github.com/davidkpiano/xstate
46.
▲
by
davidkpiano
5y ago
Is the fact that this is technically a "state machine" intentionally left out? What are the differences, if any?
47.
▲
by
davidkpiano
6y ago
I would say that behavior trees are a higher-level abstraction on top of FSMs, such that behavior trees can be represented by equivalent FSMs (although with more states/transitions).
48.
▲
by
davidkpiano
6y ago
See here: https://twitter.com/DavidKPiano/status/1372549025753395207 And here: https://github.com/davidkpiano/xstate/discussions/255
49.
▲
by
davidkpiano
6y ago
Are you ok?
50.
▲
by
davidkpiano
6y ago
Thanks for sharing! > It is not drag and drop > I imagine it’s possible to extend it to support visual manipulation and code generation It will be soon ;-)
51.
▲
by
davidkpiano
6y ago
I'm working on XState for Python: https://github.com/davidkpiano/xstate-python Still a work-in-progress, but hope to make this production-ready this year.
52.
▲
by
davidkpiano
6y ago
I'm currently building this! More info to come soon.
53.
▲
by
davidkpiano
6y ago
What makes them reusable is dependent on how you implement them. A state machine that is the simple relation: (state, event) => [state', actions] has a very reusable interface, as long as it doesn't execute the actions (effects
54.
▲
by
davidkpiano
6y ago
XState creator here, what kinds of implementation details do you not agree with? Curious to know.
55.
▲
by
davidkpiano
6y ago
Here's the funny thing: they are absolutely everywhere! It's just that the vast majority of them are implicit. What I mean by this is you can describe virtually every piece of "logic" in an app as a state machine - the
56.
▲
by
davidkpiano
6y ago
That's why statecharts exist.
57.
▲
by
davidkpiano
6y ago
> This is probably the most inefficient way to design a state machine. Your mathematical explanation of the combinatorial explosion of states and transitions is correct for state machines, and is exactly the reason why statecharts (an ex
58.
▲
by
davidkpiano
6y ago
Sure, but then you're missing out on the ability to visualize your states and transitions, much less statically analyze your state machines, generate tests for them, etc. etc. There's a lot of potential goodness that you lose when
59.
▲
by
davidkpiano
6y ago
Thanks for the kind words about XState (creator here)!
60.
▲
by
davidkpiano
6y ago
Right; for tests, it internally converts SCXML documents to a JSON format that XState can consume. In the next version of XState, it will be able to consume and produce SCXML documents as part of its public API. Another notable library that
More ›