Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

StateSmith

> 编程语言
Open source

A state machine code generation tool suitable for bare metal, embedded and more.

933 stars0 likes0 views
WebsiteGitHub

About

A state machine code generation tool suitable for bare metal, embedded and more.

StateSmith

StateSmith is a cross platform, free/open source tool for generating state machines in multiple programming languages. The generated code is human readable, has zero dependencies and is suitable for use with tiny bare metal microcontrollers, video games, apps, web, computers... It avoids dynamic memory allocations for the safety or performance inclined.

The above is my current plan, but I'll gladly help anyone add a new language. I'm hoping contributors will help me with this effort. It is tricky though...

Features and Interactive Examples

The fundamentals-1 webpage has simple interactive examples that let you explore most StateSmith features.

Quick Start (all supported languages)

Want to jump right in and just try it!?

The below tutorials use new StateSmith features that are more user friendly. They use different diagram tools, but mirror each other fairly closely otherwise.

  • Tutorial-3 - PlantUML CLI text lessons
  • Tutorial-4 - draw.io CLI text lessons & video series
  • older...

Why State Machines and StateSmith?

If you are new to state machines, then prepare to level up your toolbox! They are incredibly helpful for certain applications.

Why StateSmith? I couldn't find a quality state machine code generator that met my needs, had an attractive license, and was enjoyable to use.

The Diagram is Always Accurate!

Before I created StateSmith, it was always a pain trying to manually synchronize a hand written state machine with a drawing. Urgent client requests come in and you update the code, but do you and your team always remember to update the drawing? Probably not and so the rot begins. Documentation trust issues arise and as designs get larger, the effort to ensure the diagram is accurate starts to become quite punishing.

Now that we use StateSmith at my work, I never have to worry about the above. I love generating fully working code from the documentation. Incredibly helpful for teams and communicating with clients.

More Examples

The StateSmith-examples repo has a growing list of examples showcasing different application uses.

Is StateSmith ready for use?

We use StateSmith in a fair number of production projects at my work. It's been super helpful.

Other companies are using StateSmith in production as well (consumer electronics, autonomous vehicles, ...).

StateSmith has a strong suite of tests (730+) and behavior specification coverage. The specification integration tests read a diagram file, generate executable state machine code, then compile and execute that code in another process and ensure that the state machine behavior is exactly what was expected. The same suite of integration tests run for each supported programming language. This strong test base gives me confidence. It also allows us to refactor and optimize StateSmith without fear of accidentally breaking specified behavior.

More Info

The StateSmith GitHub wiki has a good amount of documentation right now, but always feel free to ask a question.

YouTube channel: https://www.youtube.com/@statesmith

Need help? Suggestion? Brainstorm?

Join us on discord.

Feel free to open a github issue.

Or you can use the project's discussion space.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言