4 ms·
I find in practice that is very hard to keep the table up-to-date with code changes and graphics are easier to inspect than table for complex flows. I have wri
by mratsim 6y ago
I find in practice that is very hard to keep the table up-to-date with code changes and graphics are easier to inspect than table for complex flows.
I have written a state machine generator that both produces the table and the code (no allocation, as fast as hand optimized, suitable for embedded) for my multithreading runtime to visually detect logic/design bugs in the code used:
https://github.com/mratsim/Synthesis https://github.com/mratsim/Synthesis
- jslakro 6y agoAny general concepts/theory/previous code you based your work from?
- mratsim 6y agoThe main driver are no allocation, thread-safety, easy to generate visualization and code and within performance 1% of hand-optimized code. Ergonomics have been slightly sacrificed in exchange but is still significantly better than writing everything by hand. For the theory, mostly reading the following references (in the README) and ensuring that I don't stray too much from what they describe to ease formal verification and code audits in the future: ## References - [Mealy State Machine](https://en.wikipedia.org/wiki/Mealy_machine https://en.wikipedia.org/wiki/Mealy_machine) - [Pushdown Automaton](https://en.wikipedia.org/wiki/Pushdown_automaton https://en.wikipedia.org/wiki/Pushdown_automaton) - [Communicating Finite State Machines](https://en.wikipedia.org/wiki/Communicating_finite-state_machine https://en.wikipedia.org/wiki/Communicating_finite-state_mac...) - [Petri Nets](https://en.wikipedia.org/wiki/Petri_net https://en.wikipedia.org/wiki/Petri_net) - [Kahn Process Networks](https://en.wikipedia.org/wiki/Kahn_process_networks https://en.wikipedia.org/wiki/Kahn_process_networks) Extras - [Overview/Slides from Marquette Embedded SystemS Laboratory](https://www.dejazzer.com/ece777/ECE777_3_system_modeling.pptx https://www.dejazzer.com/ece777/ECE777_3_system_modeling.ppt...) - [Berkeley's Ptolemy project](https://ptolemy.berkeley.edu/index.htm https://ptolemy.berkeley.edu/index.htm)