Has anyone read any good resources on trying to use Finite State Machines to be the top level abstraction for you system?
For example, in designing a simple tic tac toe game i figure it might help to model the flow of the game using FSM. Then having the FMS drive the program.
get-input -> ( ) -> interpret-input -> ( ) -> take-spot
This would seem to have the advantage that it makes your system execution path more readable. But I assume if this was easy and helpful i would hear more people talk about it. Sense i hear almost no one talk about it then i assume its probably only helpful in some contexts.
I’m trying to figure out what has been explored in this area. Suggestions are welcome.
IIRC there was a very simple game engine someone made that tried just that... I think it was presented at Strange Loop or something a couple of years back
If you're trying to represent your entire application's state as one giant state machine, you'll find yourself needing to decompose it into tuples of mostly-independent state, I suspect.
In some sense, the argument could be made that the Elm architecture is an example of treating the system as one giant state machine.
Update messages are essentially state transitions, with the target state being selected by the message it's passed.
What you're talking about seems less like a state machine, though, and more like a flow diagram....
More reminiscent then of 'pipes and filters'
Elm and redux too
though this is not explicitly a state machine
If you've looked into event sourcing architectures, people sometimes use BPM (aka business process managers) which resemble steps of processes, much like modelling a state machine
camunda is such an engine and can generate a graph of the process
and also colour-code the graph based on an execution
https://zeebe.io/ tries to do the same
Other interesting stuff on this space (state machines on top of distributed systems) would be Petri nets https://en.wikipedia.org/wiki/Petri_net implemented in TLA+
It is all the same underlying idea whether it is called "workflow engine" "process engine" "bpmn" "orchestration engine"
an abstraction over state machines
Product wise, I would add AWS Step Functions to that list
@drewverlee there's javalin https://github.com/hoplon/javelin which could be used to make arbitrary automata like structures
If dropping down to a pure FSM, I'd think it is because you want to constrain the behavior of the game to extremely strict semantics.