This site is still under construction.
projects

TSME

A state machine engine that compiles Amazon States Language into deterministic, embeddable Rust code.

active
rust python state-machines embedded no_std asl

TSME takes workflow definitions written in Amazon States Language (ASL) and compiles them into Rust code that runs deterministically, with journaled execution and no runtime surprises. It targets everything from cloud orchestration to ESP32-class embedded hardware.

View on Bitbucket

What it does

You define your workflow as an ASL JSON file (the same format AWS Step Functions uses). TSME’s compiler parses it, validates it, and generates Rust source code. The generated code runs against a minimal runtime that handles state transitions, retries, and error catching.

Every state transition is recorded in an append-only journal. You can replay any execution from the journal and get the same result. There are no wall-clock dependencies and no hidden state.

Project structure

The project is a Cargo workspace with several crates:

  • tsme - the runtime: state handlers, dispatchers, journal, context management
  • tsme-build - the compiler: ASL parser, validator, intermediate representation, Rust code generation
  • tsme-demo - examples and integration tests
  • xtsme - extended features for full ASL conformance (concurrent and time-aware operations)
  • pytsme - Python bindings via PyO3
  • vendor/rs-chronicle - journaling support library

Design goals

  • Deterministic: no wall-clock, no randomness, replay from journal always produces the same result
  • Transactional: append-only journal with atomic state transitions and side-effect tracking
  • Embeddable: no_std + alloc support for running on constrained hardware
  • Format-independent: pluggable ValueStore trait, so you can use JSON, MessagePack, CBOR, or FlatBuffers
  • Honest about side effects: the engine tracks which operations are non-idempotent and treats them accordingly

ASL support

Currently supports Task, Pass, Choice, Succeed, and Fail states with Retry/Catch error handling. The xtsme crate will add Parallel, Map, and Wait states for full ASL conformance.

Tech stack

Rust (Edition 2021), postcard, serde, PyO3, maturin