News for hackers. Stuff that matters.

davidkpiano

Re:Stately Agent: Build agents as state machines on Sunday July 19, 2026 @09:45PM (#48973530)
Author here; still in alpha!
Pretty cool. Looks like stately.ai but catered towards agentic state machine workflows. Really interesting!
Re:Statecharts: hierarchical state machines on Monday April 27, 2026 @04:12AM (#47918971)
This would be the closest: https://github.com/GnomesOfZurich/scxml/
Re:Statecharts: hierarchical state machines on Sunday April 26, 2026 @03:04PM (#47912923)
I loved this talk!
Re:Statecharts: hierarchical state machines on Sunday April 26, 2026 @11:52AM (#47911264)
Re:Statecharts: hierarchical state machines on Sunday April 26, 2026 @11:32AM (#47911122)
There is also @xstate/store for simple event-driven stores and atoms; just as simple as Zustand + Jotai: https://stately.ai/docs/xstate-store
Re:Statecharts: hierarchical state machines on Sunday April 26, 2026 @07:56AM (#47909613)
The next version of XState will be much more ergonomic, with a reduced API surface area, lower learning curve, and much easier for devs (and agents) to author.

But at the same time, frontier models are very good at writing XState.

Re:Statecharts: hierarchical state machines on Sunday April 26, 2026 @07:55AM (#47909608)
Statecharts are still getting some traction! XState has over 4 million weekly npm downloads. Animation tools like Rive & LottieFiles heavily advertise state machine capabilities. AI tools like LangGraph are built on state machine foundations.

It'll take some time for those apps/tools to realize the full potential of statecharts, but it's a good start.

Re:Statecharts: hierarchical state machines on Sunday April 26, 2026 @07:52AM (#47909586)
Glad to see statecharts still getting attention!

I created XState, a JS/TS library for authoring, executing, and visualizing state machines/statecharts: https://github.com/statelyai/xstate

I've been working on it for 10+ years. The main thing I've learned is that statecharts are most valuable when they're treated as executable behavior, not just documentation.

That doesn't mean you need to use them everywhere or model everything with them. They're most useful when you have behavior where the answer to "what happens next?" depends on both the current state & the event. A statechart can act as an oracle for questions like: "Given I'm in this state, when this event happens, what is the next state, and what effects should run?"

I'm close to releasing an alpha of the next major version of XState, focused on better ergonomics, type safety, and composability, as well as a new visualizer/editor.

There's also an open-source basic statechart visualizer here: https://sketch.stately.ai

For the formal/spec side, SCXML is worth reading: https://www.w3.org/TR/scxml

Also worth reading the original paper by David Harel: https://www.weizmann.ac.il/math/harel/sites/math.harel/files...

Re:Show HN: Gapless.js – gapless web audio playback on Tuesday March 03, 2026 @06:01AM (#47230739)
Really appreciate you using XState!
Re:Show HN: Browser based state machine simulator and visualizer on Saturday February 07, 2026 @09:53PM (#46930894)
Really cool! Love the XState-inspired API ;-)
Re: atoms + learning curve, this is why XState Store exists, which supports both XState-style state updates and atoms: https://stately.ai/docs/xstate-store

I also like the approach of Svelte, and realize that sometimes a full state machine isn't needed. I don't think that atoms should be used everywhere, since updating state freely without guardrails just leads to disaster long-term.

Thank you for the kind words! I somewhat agree that it is complicated and overly engineered for many applications that don't need all of the statechart features, and that it has a sizable learning curve.

I plan on greatly simplifying it for the next major version, mostly to be more idiomatic and flexible without sacrificing the state machine principles.

Re:Finite State Machine Designer on Monday August 12, 2024 @10:00AM (#41224448)
I remember this! It was one of my inspirations for creating a hierarchical state machine editor [0] and a state machine library with a visualization layer [1].

[0] https://state.new [1] https://github.com/statelyai/xstate

Re:Ask HN: Open-Source Alternative to Bland.ai on Monday May 20, 2024 @04:53PM (#40420245)
Hey thanks for linking, I'm still working on this and hope to have a beta release soon!

Stately Agent is a completely open-source library for creating (LLM) agents that adhere to state machines.

Re:Show HN: I built an online state machine editor on Sunday May 19, 2024 @11:08AM (#40407427)
How does this compare to the state machine editor on https://state.new ?
There are a lot of resources on finite state machines, especially in TypeScript, here: https://stately.ai/docs/state-machines-and-statecharts
Re:UI = F(statesⁿ) on Friday February 16, 2024 @07:08PM (#39404731)
(Creator here) Thank you for the mention!
Re:Python 3.13 Gets a JIT on Wednesday January 10, 2024 @09:53AM (#38939524)
Oh hey it's me!
You don't need to define every possible state. A state machine can serve as a higher-level structure of some of the states (statuses, modes) of parts of your app, for ease of structuring logic. But you can also create a single-state state machine and represent non-finite data as "external state".
Re:XState v5 Is Here on Friday December 01, 2023 @08:58PM (#38495095)
XState creator here!

I love that use-case. We have plenty of developers & companies using XState on the backend, and one of our main goals for XState v5 was to enable more backend use-cases, with custom & composable actor logic, deep persistence, inspection APIs, and actor-first statechart features for modeling more complex actor-actor interaction.

Ultimately, we'd love to be an open-source alternative to AWS Step Functions.

This looks awesome!
Thanks for sharing! There's an updated viz at https://stately.ai/viz but that will soon be fully part of the studio at https://state.new (which can export to Mermaid now and PlantUML soon!)
Congrats on the launch, this looks really interesting!
Would love to know more about an example "simple embedding use-case" that you may have in mind.

We're not trying to force state machines as the solution for any state-related problem; they're not a panacea, but instead a useful tool for the appropriate use-cases.

And we're definitely making a huge effort to improve the types.

Yes! Visualizing how different actors communicate with each other in general is a big goal for us this year. We're going to start with sequence diagrams.
Hey, creator of XState here!

Just want to mention that we're very close to releasing XState v5 beta, which brings even more features to the state machines & statecharts you can create, and greatly improves the developer experience, but also makes it more usable as a general-purpose state management library (or orchestration "framework" if you want to consider it that), whether on the frontend or backend.

Re:How we renamed our Design Converter to Magical Ass on Friday July 29, 2022 @10:30AM (#32277394)
Hey, XState creator here. What did you not like about XState? Hopefully there are areas we can improve on or questions we can answer. Or maybe it wasn't appropriate for the project?
Re:State Machines in Ruby: An Introduction on Friday June 24, 2022 @07:59AM (#31860464)
Creator of XState here - I agree. State machines and statecharts should be used to model parts of your application that need it, and they can potentially communicate with each other. Fitting the entire app in a single state machine is just like fitting all of the app logic in a single function; it's going to be incomprehensible.
Re:Ask HN: Can a state machine be stateless? on Sunday June 12, 2022 @05:24PM (#31718428)
Yep, the "stateless" part of the state machine is its transition function.

Older »