Monolithic Rust crate with modules. All shared types defined in a types module.
lexer → token types
parser → lexer, ast, types
types → (shared: Type, EffectRow, Capability, etc.)
ast → types
hir → types
bytecode → (shared: OpCode, Instruction, Module, etc.)
compiler → ast, hir, bytecode, types
effects → types
capabilities → types
runtime::actor → bytecode, types
runtime::mailbox → types
runtime::scheduler → actor, mailbox
runtime::heap → types
runtime::gc → heap
runtime::supervisor → actor
vm → bytecode, runtime
repl → vm, compiler, parser, lexer
- Value representation: NaN tagging on 64-bit values. Immediate integers/floats, heap pointers use NaN payload.
- Actor model: Green threads (not OS threads). M:N scheduling. Work-stealing queue per worker.
- Memory: Per-actor bump allocator. Shared immutable heap for
valobjects. No full GC in MVP - reference counting. - Type system: Basic types + generics + effects + capabilities. No dependent types in MVP.
- Bytecode: Register-based, 256 registers per frame, 32-bit fixed-width instructions.
- Lexer: Full token set (literals, keywords, operators, delimiters)
- Parser: All expression types, declarations, actor definitions, agent definitions, effect handlers
- AST: Complete node types
- Type checker: Basic types, generics, function types, actor types, effect rows, capabilities
- Bytecode: 40 core opcodes (arithmetic, control flow, memory, actor ops)
- VM: Register-based execution, direct-threaded dispatch
- Runtime: Actor spawn, message send/receive, scheduler with work-stealing, bounded mailbox, supervision trees
- Compiler: AST -> bytecode for all core constructs
- REPL: Parse -> compile -> execute cycle
- MIR optimization passes
- Full ORCA GC (reference counting in MVP)
- Multi-node distribution
- CRDT integration
- AI agent LLM integration (agent framework present, LLM effect stubbed)
- Package manager
- LSP server
Defined in src/types.rs. All modules import from here.
Type: Primitive, Tuple, Record, Variant, Function(with effect), Actor, Generic, VarEffectRow: Closed set or open row with row variableCapability: Iso, Trn, Ref, Val, Box, Tag + lattice operationsTypeVar: u64 unique ID for type variablesRegion: u64 for region variables
Expr: All expression variants (Literal, Var, Lambda, App, Let, Match, ActorNew, Send, Receive, Handle, Perform, If, Block, etc.)Decl: Function, Actor, Agent, TypeAlias, Module, ImportPattern: Wild, Var, Lit, Tuple, Record, VariantBehavior: Name, params, body, effect annotation
OpCode: u8 enumInstruction: OpCode + 3 u8 operands (or extended)Module: Constant pool + bytecode + behavior table + debug infoConstant: Int, Float, String, Bool, Nil, Unit, TypeDescriptor, FunctionRef, BehaviorRef
Value: 64-bit NaN-tagged using distinct high-16 type tags:0x7FF8nil0x7FF9unit0x7FFAbool0x7FFBint (48-bit signed payload)0x7FFCheap pointer0x7FFDactor reference0x7FFEinterned string ID0x7FF7closure reference
ActorRef: 64-bit (node_id: u16, local_id: u32, generation: u16)ActorContext: self_addr, mailbox, heap pointer, behavior table, stateMessage: behavior_id + payload bytes + sender AddrMailbox: MPSC bounded ring bufferActorHeap: bump allocator with size classesScheduler: worker threads + global queue
- Parser produces
ast::Module(list of declarations) - Compiler consumes
ast::Module, producesbytecode::Module
- VM loads
bytecode::Moduleviavm.load_module() - VM executes via
vm.run()orvm.call_function()
- VM calls runtime functions for: spawn, send, receive, monitor, link, exit
- Runtime callbacks to VM for: behavior dispatch, message delivery