Skip to content

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 24 Aug 22:52
· 24 commits to main since this release

What's Changed in v0.1.0 — Initial Public Release

fsmc (Finite State Machine Compiler) is an open-source compiler toolchain that parses statechart models from MBSE and diagram specifications (SysML v2, PlantUML, Mermaid, SCXML, JSON, DOT) and generates deterministic, zero-allocation C++17 and C++20 header-only state machine code.


🚀 Key Features & Capabilities

1. Zero-Overhead C++ Runtime Engine (include/fsm/runtime/cpp/)

  • Static Compile-Time Table Dispatch: Transition tables are resolved at compile time using template metaprogramming fold expressions with zero dynamic memory allocation and zero virtual function (vtable) lookups.
  • Deterministic Memory Footprint: Minimal object size (sizeof(fsm) = sizeof(Context*) + sizeof(state_id_t)), strictly suitable for bare-metal microcontrollers (ARM Cortex-M, RISC-V) and hard real-time systems.
  • Compile-Time Hook Detection: SFINAE duck-typing invoking on_entry, on_exit, guards, and transition actions only when defined, without requiring base class inheritance.
  • Discrete Deterministic Timers: deterministic_timer_manager for tick-based relative timeouts without background OS threads.

2. Canonical Intermediate Representation (FsmIr)

  • Strongly-typed hierarchical AST capturing states, transition triggers (signals, timeouts), composite boolean guard trees (and_, or_, not_), context variables, and metadata.
  • Deterministic 64-bit FNV-1a hashing for order-invariant reproducible identifiers.

3. Multi-Format Model Ingestion

  • Parsers for OMG SysML v2, PlantUML (@startuml), Mermaid stateDiagram-v2, W3C SCXML, Graphviz DOT, and XState JSON.
  • Renderer-safe @fsm: comment directives for lossless visual diagram enrichment.

4. Middle-End Optimizer & Diagnostics

  • Modular PassManager pipeline featuring canonicalization, dead state pruning, determinism validation, and guard algebraic simplification.
  • Rich terminal diagnostic reporting with ANSI colors, line spans, and visual error carets.

5. Command-Line Tools & Build Integration

  • fsmc: Main compiler driver for single-file and standalone C++ code generation.
  • fsm-opt: Standalone IR optimizer, static linter, and diagram format converter.
  • Full build system integration via CMake (find_package(fsmc)), Conan, and vcpkg.

🧪 Test & Verification

  • 39 modular GoogleTest suites with 100% pass rate.
  • Production showcase examples: Connection Manager, Satellite Mission Controller, Automotive Motor ECU.