Runtime model
mu programs compile to bytecode and run on a small, stack-based VM. The VM is the reference implementation for language semantics.
The execution pipeline
- Lexing and parsing produce an AST.
- The compiler lowers the AST into bytecode (via a small IR).
- The VM executes the bytecode on a stack machine.
Bytecode VM
- Fast startup and predictable execution.
- Easy to inspect and test.
- The REPL runs on the same VM pipeline.
Native backend
The native backend lowers the same IR into machine code without external assemblers. It keeps semantics aligned with the VM so programs behave the same in either mode.
Deterministic concurrency
Tasks and channels use cooperative scheduling with FIFO queues. Blocking operations (send/recv/wait/sleep and I/O) yield so the scheduler can resume other work deterministically.
Learn more
- The IR and assembler are documented in docs/ir.md.
- The VM and compiler pipeline are detailed in docs/Implementation.md.
Next steps
- Review the language tour for syntax context.
- Explore the standard library layers.
- Read the specification for the full runtime contract.