🧛🏻‍♀️ Lucy language

A concise language for describing Finite State Machines.

Complex sets of events, guards, actions, and destination states can be expressed in a single line. Nesting machines gives you a hierarchical machine.
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.
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.


state enabled {
toggle => disabled

initial state disabled {
toggle => enabled


import { createMachine } from 'xstate';

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


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