Nimble is a register-based bytecode interpreter and scripting language implemented in Rust. It prioritizes readability, clear diagnostics, and a pragmatic standard library.
- Register-Based VM: Efficient execution using a register-file model per call frame.
- Indentation-Sensitive: Python-inspired syntax for clean, readable code.
- Optional Typing: Type annotations for clarity and basic static analysis.
- Modern Error Handling: Errors as first-class values with
?propagation. - Extensible FFI: Call C-ABI symbols directly from shared libraries.
Nimble follows a standard compiler pipeline:
- Lexer: Hand-written, handles indentation and string interpolation.
- Parser: Recursive-descent parser producing a typed AST.
- Compiler: Translates AST to register-based bytecode.
- VM: Register-based virtual machine with stack-based frame management.
cargo build --releasecargo run --release -- run examples/basic/functions/defs.nmbcargo run --release -- replThe Nimble standard library includes modules for common tasks:
io: File and console I/O.ffi: Foreign Function Interface for calling C libraries.json: JSON parsing and serialization.math,string,list,map,regex,time,os,path,process.
Run the test suite:
cargo testMIT. See LICENSE.