How vbxq/elyra works
Elyra is a standalone language implementation centered on a register-based bytecode VM, with generational garbage collection, isolated heaps and a tiered Cranelift JIT. The principal workflow is source input through the CLI or public API, staged compilation, and VM execution; the repository also provides assembly, REPL, module loading, standard-library and native-module capabilities. The pipeline source confirms staged execution and caching; other links reflect the repository layout and README, not inspection of unsampled implementations.
Main entry points: pipeline.rs Compile pipeline · core.rs Register VM · api/mod.rs Driver API · loader/mod.rs Module loader
Components 22
User interfaces
- CLI commands
cli/src/cli/commands/run.rs - Public API
aelys/src/api/mod.rs - REPL
driver/src/api/repl.rs - Driver API
driver/src/api/mod.rs
Compilation
- Compile pipeline
driver/src/pipeline/pipeline.rs - Lexer
frontend/src/lexer/mod.rs - Parser and AST
frontend/src/parser/mod.rs - Type inference
sema/src/infer.rs - Optimizer
opt/src/passes/optimizer.rs - Bytecode compiler
backend/src/compiler/pipeline.rs - Bytecode format
bytecode/src/bytecode/mod.rs - Assembler and disassembler
bytecode/src/asm/mod.rs
Runtime
- Register VM
runtime/src/vm/core.rs - Heap and GC
bytecode/src/heap/mod.rs - Runtime values
bytecode/src/object/mod.rs - Cranelift JIT
aelys/src/jit/mod.rs - Standard library
runtime/src/stdlib/mod.rs
Modules and extensions
- Module loader
driver/src/modules/loader/mod.rs - Module resolution
modules/src/resolution/mod.rs - Native module ABI
native/src/lib.rs - Native macros
native-macros/src/lib.rs
Other components
- Language user
Connections 27
- Language user → CLI commands: runs programs
- Language user → Public API: calls API
- CLI commands → Driver API: dispatches commands
- Public API → Driver API: delegates
- REPL → Driver API: submits input
- Driver API → Compile pipeline: executes pipeline
- Compile pipeline → Lexer: tokenizes
- Compile pipeline → Parser and AST: parses
- Compile pipeline → Type inference: infers types
- Compile pipeline → Optimizer: optimizes
- Compile pipeline → Bytecode compiler: compiles
- Lexer → Parser and AST: tokens
- Parser and AST → Type inference: AST
- Type inference → Optimizer: typed AST
- Optimizer → Bytecode compiler: optimized AST
- Bytecode compiler → Bytecode format: emits bytecode
- Driver API → Register VM: runs bytecode
- Assembler and disassembler → Bytecode format: assembles
- Register VM → Bytecode format: decodes
- Register VM → Heap and GC: allocates and collects
- Register VM → Runtime values: operates on values
- Register VM → Standard library: dispatches natives
- Register VM → Cranelift JIT: compiles hot code
- Driver API → Module loader: loads imports
- Module loader → Module resolution: resolves modules
- Module loader → Native module ABI: loads native modules
- Native macros → Native module ABI: generates wrappers