architecture

2018-02-20T20:07:38.000618Z

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.

fellshard 2018-02-20T20:47:26.000368Z

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

fellshard 2018-02-20T20:48:15.000176Z

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.

fellshard 2018-02-20T20:49:14.000576Z

In some sense, the argument could be made that the Elm architecture is an example of treating the system as one giant state machine.

fellshard 2018-02-20T20:50:38.000566Z

Update messages are essentially state transitions, with the target state being selected by the message it's passed.

fellshard 2018-02-20T20:51:31.000751Z

What you're talking about seems less like a state machine, though, and more like a flow diagram....

fellshard 2018-02-20T20:52:22.000273Z

More reminiscent then of 'pipes and filters'

Ivan 2018-02-20T21:05:44.000531Z

Elm and redux too

Ivan 2018-02-20T21:05:55.000418Z

though this is not explicitly a state machine

Ivan 2018-02-20T21:07:22.000487Z

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

Ivan 2018-02-20T21:07:48.000156Z

https://camunda.com/products/

Ivan 2018-02-20T21:08:07.000663Z

camunda is such an engine and can generate a graph of the process

Ivan 2018-02-20T21:08:25.000592Z

and also colour-code the graph based on an execution

Ivan 2018-02-20T21:08:50.000019Z

https://zeebe.io/ tries to do the same

Ivan 2018-02-20T21:13:49.000269Z

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+

Ivan 2018-02-20T21:19:37.000098Z

https://github.com/bpmn-io

Ivan 2018-02-20T21:19:41.000072Z

https://github.com/uber/cadence

Ivan 2018-02-20T21:19:45.000122Z

https://github.com/Netflix/conductor

Ivan 2018-02-20T21:21:07.000165Z

It is all the same underlying idea whether it is called "workflow engine" "process engine" "bpmn" "orchestration engine"

Ivan 2018-02-20T21:21:24.000240Z

an abstraction over state machines

2018-02-20T21:29:53.000675Z

Product wise, I would add AWS Step Functions to that list

john 2018-02-20T22:14:27.000646Z

@drewverlee there's javalin https://github.com/hoplon/javelin which could be used to make arbitrary automata like structures

john 2018-02-20T22:21:39.000476Z

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.

Ivan 2018-02-20T22:33:56.000228Z

https://github.com/ztellman/automat

Ivan 2018-02-20T22:34:00.000513Z

https://github.com/lacuna/heron