| Crates.io | oxidate-fsm |
| lib.rs | oxidate-fsm |
| version | 0.1.0 |
| created_at | 2026-01-11 02:25:58.771226+00 |
| updated_at | 2026-01-11 02:25:58.771226+00 |
| description | FSM framework with GUI visualization - Mermaid-like DSL to Rust code generator |
| homepage | https://github.com/JoseClaudioSJr/Oxidate |
| repository | https://github.com/JoseClaudioSJr/Oxidate |
| max_upload_size | |
| id | 2035111 |
| size | 469,270 |
FSM Framework with GUI Visualization
Oxidate is a Rust-based tool for designing, visualizing, and generating code from Finite State Machines (FSMs). It features a Mermaid-like DSL, an interactive GUI editor with simulation capabilities, and code generation for Standard Rust.
For embedded development, Oxidate Pro is available separately. Contact to purchase/access:
Embassy — Async Active Object pattern for embedded
RTIC — Real-time event queues with priorities
Events with Payload — Typed data with events
HSM — Hierarchical State Machines
rustup install stable)# Install from crates.io
# GUI app + CLI (default features)
cargo install oxidate-fsm
# CLI-only (no GUI deps)
cargo install oxidate-fsm --no-default-features
# Clone the repository
git clone https://github.com/JoseClaudioSJr/Oxidate.git
cd oxidate
# Install JS layout dependencies
cd tools/dagre-svg-demo && npm install && cd ../..
# Run the GUI
cargo run --release
# Parse and validate an FSM file
cargo run --bin oxidate-cli -- examples/traffic_light.fsm
Oxidate uses a Mermaid-inspired DSL for defining FSMs:
fsm TrafficLight {
// Initial state
[*] --> Red
// State definitions
state Red: "Stop signal" {
entry / turn_on_red()
exit / turn_off_red()
}
state Yellow: "Caution signal"
state Green: "Go signal"
// Transitions
Red --> Green : timer_expired
Green --> Yellow : timer_expired
Yellow --> Red : timer_expired
}
// Simple state
state Idle
// State with description
state Running: "System is active"
// State with entry/exit actions
state Active {
entry / initialize()
exit / cleanup()
}
// Basic transition
StateA --> StateB
// Transition with event trigger
StateA --> StateB : button_press
// Transition with guard condition
StateA --> StateB : event [guard_condition]
// Transition with action
StateA --> StateB : event / do_something()
// Full syntax
StateA --> StateB : event [guard] / action()
// Define a timer
timer blink_timer = 500 -> Tick periodic
timer timeout = 3000 -> Timeout
// Control timers in states
state Waiting {
entry / start_timer(timeout)
exit / stop_timer(timeout)
}
choice CheckCondition {
[condition1] -> StateA / action1()
[condition2] -> StateB
[else] -> DefaultState
}
// Transition to choice point
StateX --> <<CheckCondition>> : evaluate
Oxidate generates idiomatic Rust code for three targets:
pub enum TrafficLightState {
Red,
Yellow,
Green,
}
pub enum TrafficLightEvent {
TimerExpired,
}
impl TrafficLight {
pub fn handle_event(&mut self, event: TrafficLightEvent) {
// Generated transition logic
}
}
#![no_std] compatibleembassy_time::Timer#![no_std] compatibleoxidate/
├── src/
│ ├── main.rs # GUI application
│ ├── cli.rs # Command-line interface
│ ├── lib.rs # Library exports
│ ├── fsm/ # FSM data structures
│ │ └── mod.rs
│ ├── parser/ # DSL parser (pest)
│ │ ├── mod.rs
│ │ └── fsm.pest # Grammar definition
│ └── codegen/ # Code generators
│ └── mod.rs
├── tools/
│ ├── dagre-svg-demo/ # Node.js Dagre layout backend
│ ├── gen_icon.py # Icon generator
│ └── package/ # Packaging scripts
├── assets/
│ ├── oxidate.icns # macOS icon
│ ├── oxidate.png # PNG icon
│ └── linux/ # Linux desktop integration
├── docs/
│ └── RELEASING.md # Release/packaging guide
└── Cargo.toml
flowchart TB
subgraph GUI["GUI - egui"]
E["Editor Panel"]
V["Visualizer Panel"]
S["Simulator Controls"]
end
P["Parser - pest DSL"]
F["FsmDefinition<br/>states, transitions, etc"]
L["Layout - Dagre/JS"]
C["Codegen - Rust"]
Sim["Simulation Runtime"]
E --> P --> F
F --> C
F --> L --> V
S --> Sim
F --> Sim
Sim --> V
The visualization uses a strict separation:
This ensures consistent, professional layouts without heuristic edge routing.
| Variable | Description |
|---|---|
OXIDATE_DAGRE_DIR |
Override path to tools/dagre-svg-demo |
OXIDATE_NODE |
Override path to Node.js binary |
See docs/RELEASING.md for detailed packaging instructions.
# Development
cargo run
# Release
cargo build --release
# macOS .app bundle
cargo bundle --release
# Linux .deb
cargo deb
Contributions are welcome! Please:
MIT License — see LICENSE for details.