Rulebook Documentation
The Rulebook language lets you write complex interactive systems with the simplicity of synchronous code, while retaining all the advantages and none of the disadvantages of asynchronous code. Projects that benefit from Rulebook include reinforcement-learning environments, video games, sophisticated UIs, and more.
4hammer (our flagship demo) shows Rulebook in action.
Why Rulebook?
Write self-configuring UIs – the UI introspects your program graph and adapts its controls on the fly.
Solve the interactive inversion-of-control problem at the language level—no more interactive spaghetti.
Capture every run – automatically store, load, print, replay, and mutate both state and execution traces.
Push-button testing – drop in standard fuzzers, formal proofs, or reinforcement-learning agents.
Remote execution – ship interactive logic across the network with a zero-boilerplate RPC layer.
Native performance - Zero mallocs unless explicitly requested by the user.
Under the hood
Rulebook’s defining idea is the notion of Action functions with SPIN properties, a unique blend of uncommon and new language features that allow all of the above features.
Integration
Rulebook compiles to one shared library (or WebAssembly module) with a C-compatible ABI and generated bindings for C, C++, C#, Python, and Godot Script. Use it the way SQL complements those languages—drop it in wherever interactive logic is the hard part.
Reinforcement Learning Docs:
UI, Controller and Gameplay Programming
UI, controller and gameplay programming are among the sections that benefit the most from using Rulebook. Beside automatically fuzz , prove correct and run reinforcement learning on your program, write self-configuring UIs , Rulebook automatically provides a sharp division between UI concerns and Controllers or Gameplay.
UIs, Controllers, Gameplay:
References:
- Rulebook Language
- RLC
- Rulebook Language
- Rulebook Types
- Enum Types
- Array Types
- Alternative Types
- Class Types
- Function Types
- Functions
- Action Functions
- Frm and Ctx Qualifiers
- Action Statements
- Actions Statements
- Subaction Statements
- Context Variables in Subaction Statements
- Return Statements
- If Statements
- While Statements
- Using Statements
- Declaration Statements
- Reference Declaration Statements
- Frame Declarations Statements
- Declaration Statements Destruction
- Call Expressions
- stdlib