Is there a in that can be used to program state machines?

@musicmatze I started building one under but it got lost under a whole lot of other work... I am unsure whether I should continue this project or not. It is based on procedural macros, which are a whole lot of fun to develop but not sure if it is satisfying to use such proc-macro libs 🙈😅

@fin_ger would it be possible to use it for implementing user-defined key bindings?

Like a thing where a user is able to define input modes like with vim and then key bindings within them...

I need to be able to query the current state at any time as well as the possible next states and of course need to be able to trigger actions in (eg.) Cursive with the "leaf" states!

@musicmatze Hmm, looks like it would be possible but the current API is not capable of providing the set of next possible states. This can be hard as I was targeting state transitions with parameters where a user-defined function would decide which would be the next state based on the parameters. This is impossible to predict without further API restrictions.

@fin_ger ah okay. Maybe I just have to write my own crate for that...

@fin_ger do you know a DSL for specifying such things (mappings, state transitions) that is easy enough to be used as configuration language for a user-facing application, by any chance?

@musicmatze yeah, kindof... I started creating the proc-macro which is something like a dsl... But not finished yet 😅

@fin_ger yeah well, but a proc macro is nothing a user should have to write...

@musicmatze Yes, that's right. But I think key bindings should be embedded into a simple specific syntax for key bindings, instead of a general purpose state-machine syntax.


Sign in to participate in the conversation
Mastodon for Tech Folks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!