Reading @a_hoverbear's post on state machines.
https://hoverbear.org/blog/rust-state-machine-pattern/#three-state-two-transitions …
Now wondering: what if From/Into impls would be possible for enum member -> member. Could that be an angle to make state machines easier to write?
-
Show this thread
-
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.
2 replies 1 retweet 8 likesShow 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.
2 replies 0 retweets 3 likesShow this thread -
Replying to @yoshuawuyts
Also explore `TryFrom` for handling failure states! Also explore APIs using `impl Into<X>`! :) Thanks for the link! Let me know if you want to chat about this!
2 replies 0 retweets 2 likes
Maybe I'll take you up on that! For now I want to explore it a bit further and try it out for a small parser so I get a feel for it. But suspect it'll work nicely 
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.