Back to browse
GitHub Repository

A declarative framework for rule-based state machines in Rust.

114 starsRust

Banish: A declarative framework for rule-based state machines in Rust

by LoganFlaherty·Mar 22, 2026·1 point·0 comments

AI Analysis

●●SolidWizardryNiche Gem

Compile-time generated scheduler beats manual match-loop-state hell for complex state machines.

Strengths
  • Proc macro generates the runtime scheduler at compile time instead of interpreting at runtime.
  • Async-runtime-agnostic design works with tokio, async-std, or smol without integration code.
  • Runtime dispatch via BanishDispatch trait enables resumable, externally-configurable machines.
Weaknesses
  • State machine libraries already exist in Rust (smlang, state_machine_future).
  • Niche audience limits adoption to developers with genuinely complex state requirements.
Target Audience

Rust developers building complex stateful systems

Similar To

smlang · state_machine_future · YAKI

Post Description

Banish generates a fixed-point runtime at compile time and schedules your states through it. You declare states and rules, the framework decides when they run. Release 1.3.0 adds async support, runtime dispatch, block attributes, transition guards, and scoped variable declarations, rounding out what I think is a genuine framework-level feature set for a category of problem that usually ends up as a loop wrapping a match wrapping a pile of flags.

The before/after comparison in the README shows the difference pretty concisely. Happy to answer questions about the design tradeoffs, particularly around the proc macro implementation. Thanks for reading.

Similar Projects

Infrastructure●●Solid

Raft in Rust

Sans-I/O Raft core with pluggable transport and storage traits.

Big BrainNiche Gem
carterburn
1019d ago
AI/MLPass

AEF – Agents State Machine

Two-commit spec repo with no working implementation or demo.

Ship It
mikemasam
103mo ago