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

The “Microwave oven with grill” diagram: the composite state Heating with the nested states Toasting and Baking, the state Door open and the transitions on the events OPEN_DOOR and CLOSE_DOOR
Translated from a diagram of the course «Введение в программирование машин состояний (ПРИМС) в Arduino» (in Russian)

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.

  1. Draw. The diagram is drawn in the CyberiadaPro editor or in Cyberiada IDE; a language model can draw it from a description.
  2. 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.
  3. Check. The conformance tests check files and libraries against the standards.
  4. 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.
  5. Run — on a controller, a robot, in a game or a simulator.

The platform layers

The platform layers: the standards at the base, the libraries, the tools and the applications above them
LayerWhat it contains
StandardsPNST 984-2024, PNST 1044-2025, the conformance tests
Librariesreading and writing diagrams in C, C++, Python, TypeScript and C#, geometry
Toolseditors, code generators, dispatchers, the firmware flasher
Applicationsembedded 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.