Overview
Zephyr is a high-performance embedded scripting language for game engines that adopts Rust-style syntax while eliminating the complexity of borrow checking and lifetime annotations.
Core Features
- Supported Paradigms: Functions, Structs, Enums, Traits/Impls, Pattern Matching (
match), Generics, Coroutines, Module Import/Export. - Control Flow: Supports
if let,while let, and range-based iterators (0..n,0..=n). - Runtime Architecture: Register-based bytecode VM with superinstruction fusion. In Release builds, the AST is skipped entirely — only bytecode is used for execution.
- Garbage Collection: Generational GC with card tracking and write barriers.
- Coroutines: Independent heap-reserved memory frames (
CoroutineObject), fully decoupled from the C++ native call stack. - Safe Host Integration: Explicit C++ runtime host bindings with a 4-tier handle lifecycle system (
Frame,Tick,Persistent,Stable).
Constraints
- No macro system.
- No Rust-level ownership/lifetime validation (memory managed via generational GC).
- Cross-boundary
async/awaitwith C++ is handled via coroutine suspension.
Technical Specifications
⚡ VM Execution
Superinstruction fusion and virtual register allocation for optimized instruction dispatch.
♻️ Memory Management
4-Space generational GC with write barriers to ensure deterministic frame timing.
🎮 State Management
Heap-preserved coroutine frames for complex asynchronous logic without stack overhead.
🛡️ Host Integration
Lifecycle-managed handles for safe C++ native memory bridging and pointer protection.