SCE - SCXML Core Engine

High-performance W3C SCXML 1.0 state machine engine with AOT code generation. From embedded C++ to Android, Spring Boot, Rust, Go, and Python.

W3C SCXML 1.0 Compliant C++ AOT Kotlin/JVM Rust Go Python

Tools & Demos

Online Code Generator

Generate optimized C++ state machine code from SCXML directly in your browser. Powered by Pyodide.

Try Code Generator

DOOM + SCXML Demo

DOOM running in WebAssembly with real-time SCXML state machine visualization overlay.

Play DOOM Demo

W3C Compliance Report

Full W3C SCXML 1.0 test suite results. 202/202 tests passing across multiple backends.

View Test Results

GitHub Repository

Source code, documentation, examples, and build instructions for all supported platforms.

View on GitHub

What is SCE?

SCE (SCXML Core Engine) is an open-source implementation of the W3C SCXML 1.0 specification — the standard for describing state machines and statecharts in XML. Unlike interpreter-based engines, SCE uses Ahead-of-Time (AOT) code generation to compile SCXML documents into native C++, Kotlin, Rust, or Go code at build time, eliminating all runtime parsing overhead. Python bindings via pybind11 provide direct access to the C++ interpreter engine.

This makes SCE suitable for resource-constrained embedded systems where every byte matters, Android Automotive OS (AAOS) applications that require deterministic state management, and Spring Boot microservices that benefit from type-safe state machine integration. The generated state machines start at just 8 bytes of memory and use zero virtual function calls, enabling the compiler to fully inline state transitions.

SCE passes all 202 mandatory W3C SCXML conformance tests across all five backends (C++, Kotlin, Rust, Go, and Python) — supporting datamodels, parallel states, history states, invocations, and delayed event delivery as specified by the W3C standard.

Language Guides

C++ State Machine

Zero-overhead AOT code generation. Compile-time enums, no virtual functions, 8-byte footprint. Supports Qt, GLib, and embedded systems.

C++ Guide

Kotlin State Machine

Spring Boot auto-configuration and Android AAOS support. Three script engines: Rhino, Lua 5.4, QuickJS.

Kotlin Guide

Rust State Machine

Type-safe generated Rust code from W3C SCXML. Full 202/202 conformance with hierarchical and parallel states.

Rust Guide

Go State Machine

Native Go with generics. Pure Go Lua scripting (no CGo). 202/202 W3C compliance with zero external runtime dependencies.

Go Guide

Python State Machine

pybind11 bindings wrapping the C++ interpreter. 202/202 W3C compliance with HTTP event support and context manager API.

Python Guide

Why SCE?

8 bytes
Minimal state machine footprint
202/202
W3C SCXML tests passing
5
Backend languages (C++, Kotlin, Rust, Go, Python)
0
Runtime overhead (AOT compiled)