🧛🏻‍♀️ Lucy language

A concise language for describing Finite State Machines.

Expressive
Complex sets of events, guards, actions, and destination states can be expressed in a single line. Nesting machines gives you a hierarchical machine.
Complete
Lucy compiles to XState, the best-in-class JavaScript library for FSMs and statecharts. Lucy supports all of its core features, meaning you get the full power of statecharts by using Lucy.
Fast
Lucy is written in C and compiled to WebAssembly for easy use in JavaScript projects. The wasm backend is 15x faster than the previous JavaScript based compiler.

toggle.lucy

state enabled {
toggle => disabled
}

initial state disabled {
toggle => enabled
}

out.js

import { createMachine } from 'xstate';

export default function() {
return createMachine({
initial: 'disabled',
states: {
enabled: {
on: {
toggle: 'disabled'
}
},
disabled: {
on: {
toggle: 'enabled'
}
}
}
});
}

Install

See the install page for detailed instructions on the various ways you can use Lucy, such as with popular JavaScript build tools.

To use the command-line compiler install with:

curl -sSf https://lucylang.org/install.sh | bash