mudasobwa
Elixir Blog Post: Finitomata :: The Proper FSM for Elixir
Blogged about the motivation and reasoning behind my idea to create yet another FSM library. Long story short: I did it in a proper way ![]()
Most Liked
ityonemo
I wrote this library which seems similar:
mudasobwa
Ouch, indeed. Great one! I googled and grepped hex.pm but somehow failed to nail it down. Two independent solutions so similar is a hint it’s a proper approach.
There is one significant difference, though. The definition made of PlantUML allows a no-cost visualization, after I’ve done Make embedded FSM description visible in VSCode · Issue #2 · am-kantox/finitomata · GitHub, the diagram would be transparently visible in VSCode, and the mix task to generate the diagram will also be available soon.
Also, by hiding all the OTP stuff under the hood and exposing callbacks only, I hope I made it more beginners-friendly.
KristerV
very interesting. the example at the end could be a bit more ‘real world’ as i’ve only heard about FSM used in games. What do you use it for?
I wanted something, that is error-prone and easy to grasp.
You probably wanted to say “not error-prone”?
mudasobwa
The real-world example would have not fit the page ![]()
We in Fintech use FSMs for literally everything. Consider a long-lived “transaction” when the client puts an order and saves it, in ten days comes and tries to execute it. We are to contact a bank, receive a response and either trade or contact client for why it could not be traded etc. It’s like eventlog, but for the state of the object. We must prevent the client from the attempt to execute incomplete order, or to re-execute the order rejected by bank without introducing any changes, or like. One FSM obsoletes dozens of if conditional statements.
Of course, thanks, fixed.
derek-zhou
I follow your blog already; the contents are always superb. May I suggest you to add the tags in your feed? You already have a nice tagging system; it’s a shame that this tagging system is not exposed through your feed. Since you are using Atom, the standard format shall be:
<category term="elixir" />
...







