zaboco/typed-machine

State machine, react, adapters, typing

brucou opened this issue · 3 comments

Hey there,

that was an interesting read reviewing your library. You use a lot of similar ideas to my own state machine library (Kingly) that I have been developing in the last three years, so I wanted to share some insights I came through with you.

I invite you to take a look there if you are interested in the subject. Apart from some theoretical introduction to state machines vs. user interfaces, you will find:

  • some examples of interfaces implemented with state machines, so you can check your own theory with these or try to type them
  • the inversion of control (if I understood well) that you recommend in your talk. I totally agree that this is the sound way to go, with nice architectural implications. I wrote an online interface to TMDB movie database with one machine, and 7 ui frameworks without ever touching the machine. Full article published on infoQ.
  • a command/query decoupling of the interface behaviour and the UI. That may be important if you want to generalize render actions to any other kind of effect (because rendering is just an effect like any other). I do recommend you to have a look at Kingly's concepts and design. It could a source of inspiration for what you are doing.

What I do not have is typing which is intentionally left for last. Your typing method is interesting, I watched the Heroes talk, read the slides, and just skimmed through the README but I think I understand how you manage to type transitions and that is indeed interesting. Some inspiration for me too.

Hey,

Interesting library and article, thanks for sharing that. There are indeed, similar ideas between these libraries.

But there is one thing that you mentioned that was new to me, and that is the command/query decoupling and that the rendering is just another effect. That's something interesting to think about 🙂, especially in the context for types. Thanks!

For information, @zaboco I stumbled across this article also dealing with typing state machines: https://levelup.gitconnected.com/type-level-finite-state-machines-6714f849255. Taking advantage of the opportunity to close this issue too :-)

Thanks for the article @brucou, it offers other interesting things to think about :)