Examples Catalog
All examples live in the repository under examples/.
Run any example with:
raml examples/Language/01_basics.rml
Language Examples
examples/Language/01_basics.rmlVariables, arithmetic, conditionals, loops, and ternary.examples/Language/02_structs_methods.rmlObjects, methods, and standalone functions.examples/Language/03_memory_pointers.rmlHeap allocation, pointers, address operations, andfree.examples/Language/04_nested_structs.rmlNested objects and field access.examples/Language/05_flow_errors_jump.rmlLabels,jump,try/catch/end, andswitch.examples/Language/06_bitstreams_io.rmlBitstreams withkeyboard,save, andload.examples/Language/07_example.rmlBit operations, lengths, and shifts.
App Examples
Calculator
examples/Apps/calculator.rml - Simple interactive CLI calculator demonstrating:
- Arithmetic operations with bit-precise types
- Interactive input/output with
keyboardandprint - Control flow with
if/orif/else
Tic-Tac-Toe
examples/Apps/tictactoe.rml - Two-player tic-tac-toe in the terminal demonstrating:
- Objects with fields and methods (
boardwithget,set,full,winner,print) - Method calls with arguments:
->b:get move,->b:set move player - Bitstream input handling:
move = keyboardreturnsbs_t - Automatic type conversion when passing bitstreams as numeric arguments
- Complex control flow with
while,if,break,continue - Object initialization with
make
Inventory System
examples/Apps/inventory_system.rml - Warehouse inventory management demonstrating:
- Objects with multiple fields and methods (inline + block + external definitions)
- Nested method calls and function return values
switchloopwithcontinuefor looping switch behavior- File I/O with
saveandload - Error handling with
try/catch/end - Pointer operations, compound assignments, and pre/post increment
- Bitwise operators, shift operations, and address equality (
=#=) - Double-colon boolean grouping (
::expr::)