A statically typed language with Python-style indentation, LLVM-based code generation, and an integrated toolchain.
- Pythonic syntax - indentation-based blocks, no curly braces or semicolons
- Static type system with type inference for locals and explicit typing for functions/parameters
- LLVM codegen - emits textual LLVM IR, assembles via
clang -c - Cross-platform linker - auto-discovers
cc,clang,gcc, orlink.exe - Built-in print -
print("text"),print_int(42),print_str("text")backed by the ember runtime - Standard library -
load std.<module>andload stdfor the unified stdlib namespace - C FFI -
extern fn printf(fmt: String) -> Intfor binding native libraries - Rich diagnostics - parse and type errors rendered with source context via miette
- Auto-run -
nimble compile file.nbl -rcompiles and runs in one step - Unified Toolchain - everything integrated into a single
nimblecrate
# Install LLVM / clang
# Ubuntu/Debian: sudo apt install llvm clang
# macOS: brew install llvm
# Windows: https://llvm.org/builds/
# Build the toolchain
cargo build --release
# Write and compile a program
cat > hello.nbl << 'EOF'
fn main() -> Int:
print("hello, world")
return 0
EOF
./target/release/nimble compile hello.nbl -rfn fib(n: Int) -> Int:
if n <= 1:
return n
else:
return fib(n - 1) + fib(n - 2)
fn main() -> Int:
print_str("fibonacci(")
print_int(fib(10))
print_str(")\n")
return 0| Type | LLVM repr | Description |
|---|---|---|
Int |
i64 |
64-bit signed integer |
Float |
double |
64-bit IEEE float |
Bool |
i1 |
Boolean |
String |
ptr |
Null-terminated C string |
Void |
void |
No return value |
| Function | Signature | Runtime symbol |
|---|---|---|
print |
(String) -> Void |
nimble_print (with newline) |
print_int |
(Int) -> Void |
nimble_print_i64 |
print_str |
(String) -> Void |
nimble_print_str (no newline) |
The standard library lives under src/std/ and can be imported with:
load std- rootstdaggregator moduleload std.io- I/O helpersload std.math- math functionsload std.core- common utility functionsload std.alloc- allocation helpersload std.log- logging helpersload std.testing- assertion helpers
See docs/manual/stdlib.md for the full stdlib overview and API reference.
The entire Nimble toolchain is integrated into a single nimble binary.
| Command | Role | Description |
|---|---|---|
nimble init |
Project Init | Create a new Nimble project with a default layout |
nimble build |
Build System | Build the current project using the manifest |
nimble run |
Project Runner | Run the current project |
nimble compile |
Compiler | Compile a single .nbl file to an executable. Flags: -o <file>, --emit-llvm, -r / --run |
nimble fmt |
Formatter | Format Nimble source code canonically |
nimble repl |
REPL | Start an interactive Nimble REPL |
nimble lsp |
LSP Server | Start the Language Server for IDE support |
nimble install |
Package Manager | Install standalone binaries from remote URIs |
nimble pkg |
Package Manager | Manage library dependencies |
ember |
Runtime | Runtime primitives (now a module in src/ember) |
source.nbl β lexer β parser β typechecker β codegen β .ll β clang -c β .obj
β
linker (clang -o)
β
a.exe β ember.lib
Implemented:
- Lexer, parser, AST, type checker, code generator
if/elif/else,while,for,break,continue,return,load,extern fn- Immutable
letand mutablevar - Struct declarations, struct literals, and field access
- Interface declarations with structural conformance checks
- Generic type syntax and generic instance unification
- Function definitions and basic module loading
- REPL, formatter, and LSP scaffolding
- Project tooling (
init,build,run,pkg,install,fetch)
Still early:
- A documented package registry protocol
- Stable semantics for ownership, mutation, and concurrency
- A broader standard library
cargo build --releaseThe release profile enables LTO, single codegen unit, panic=abort, and symbol stripping.