As to *why* state machines are interesting: they feel much like an extension of enums. Enums enumerate various states. State machines enumerate the transitions *between* those states. I think if that were something a lang would help with it might be really nice.
-
-
Show this thread
-
Reason why I was reading up on state machines: I am wondering how practical of a replacement they could be for parser combinators. Trying to find out a middleground between defining a full grammar and completely hand rolling all logic. Encoding transitions might be a good one.
Show this thread
End of conversation
New conversation -
-
-
I recently explored this to implement `Bowling.` The biggest pain was not being able to define enum subsets. Every `state + event` transition needs its own TransitionResult enum and `impl From<TranstitionResult> for StateNode` that's pure repitition
-
The result, if you're interested:https://exercism.io/tracks/rust/exercises/bowling/solutions/9b603f0e6cff4b6f8b00bb52c9102ddd …
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.