Announcing `crem`

I would like to announce the first release of crem

crem stands for compositional representable executable machines.

It allows defining state machines (Mealy machines in fact), composing them to build bigger machines out of smaller ones and then running them and drawing their flow and their state space.

The repository contains extensive documentation and several examples, including domain modelling with state machines and a terminal-base adventure game.

Please check it out and let me know how it could be improved

18 Likes

A+ for the Mermaid rendering, you should advertise this more. :slight_smile:

3 Likes

State machines don’t get the love they should, this is awesome. I will rewrite and formalize some internal state machines used on an app I wrote.

1 Like

Hi! Nice! Please let me know if you encounter any issue or even any suboptimal thing

1 Like

Do you have any comparison against machines?
Good to see another approach to state machines.
Type safe state transitions are a nice feature (for example hobbitTopology).

2 Likes

I am no machines expert, but I’ll try to provide some thoughts:

  • machines focus appears more to be on creating a streaming library, like pipes or conduit, and it happens to use state machines. crem on the other is (at least for now) only a state machine library. Maybe it would be possible to provide a AutomatonT instance for crem StateMachineT type, so that you can then use crem state machines inside the machines framework.
  • machines Machines are demand driven (I guess this means that they will proceed in their evaluation only if there is request of another output), while crem StateMachine will execute until it is finished.
  • crem focuses more on type safety and the ability to create a graphical representation out of a state machine
  • I haven’t tested performance-wise. I guess compilation times could be higher for crem but I expect run times to be similar
4 Likes