Platform
How Cyberiada works: from a hierarchical state machine diagram to a running program.
Cyberiada is a platform for programming behaviour of cyber-physical systems including devices and controllers, robots, game characters, software agents. The behaviour is not the text of a program but a diagram of an extended hierarchical state machine (HSM) — a UML 2 state machine diagram with the actions and the events of the target platform.
The diagram
- A state is a mode of the system. The
entryandexitactions run when the system enters and leaves it. - A transition fires on an event: a button press, a timer tick, a message from another device.
- Hierarchy. States nest: Heating holds Toasting and Baking, and the transition on OPEN_DOOR is written once and leaves either of them.
The way of a diagram
HSM diagrams do not require programm code — the diagram is the code including the case of code generation basing on the diagram.
- Draw. The diagram is drawn in the CyberiadaPro editor or in Cyberiada IDE; a language model can draw it from a description.
- Store. The file is in the CyberiadaML-GraphML format (PNST 1044-2025); the libraries in C, C++, Python, TypeScript and C# read and write it.
- Check. The conformance tests check files and libraries against the standards.
- Generate or run. The generators produce the code for Arduino, TJC-HSM controllers, ROS2 nodes and Python; the dispatchers run a diagram without generating code.
- Run — on a controller, a robot, in a game or a simulator.
The platform layers
| Layer | What it contains |
|---|---|
| Standards | PNST 984-2024, PNST 1044-2025, the conformance tests |
| Libraries | reading and writing diagrams in C, C++, Python, TypeScript and C#, geometry |
| Tools | editors, code generators, dispatchers, the firmware flasher |
| Applications | embedded systems, ROS2 robots, games and simulators, language models |
Each layer rests on the one below: the tools work with diagrams through the libraries, and the libraries follow the standards and are checked by the conformance tests.