1 stable release
| 1.7.3 | Jul 17, 2026 |
|---|
#351 in Programming languages
1MB
18K
SLoC
Zamin Programming Language
Zamin is a simple, expressive scripting language with a Rust-based interpreter. It combines modern language features -- closures, pattern matching, string interpolation, and a module system -- with a lightweight bytecode VM, optional GPU acceleration, and a built-in project manager.
print("Hello, Zamin!");
Documentation
Full Documentation -- language guide, standard library reference, GUI toolkit guide, OpenCV guide, and more.
| Page | Description |
|---|---|
| Getting Started | Installation, setup, and first script |
| Language Guide | Complete language reference |
| Standard Library | All 25+ built-in modules |
| GUI Toolkit | Sol (Windows) and Luna (Linux) |
| OpenCV | Computer vision and image processing |
| Advanced Guide | C extensions, Python interop, CUDA, embedding |
| Project Management | CLI commands and project structure |
| Performance | Benchmarks and optimization tips |
| FAQ | Frequently asked questions |
Quick Start
git clone https://github.com/young-developer90/zamin.git
cd zamin
cargo build --release
./target/release/zamin run examples/hello.zamin
Start the REPL
./target/release/zamin repl
Zamin> let x = 42;
Zamin> print(f"the answer is {x}");
the answer is 42
Zamin> func fib(n) { if n <= 1 { return n; } return fib(n-1) + fib(n-2); }
Zamin> print(fib(20));
6765
Examples
Fibonacci
func fibonacci(n) {
if n <= 1 { return n; }
return fibonacci(n - 1) + fibonacci(n - 2);
}
for i in 0..10 { print(f"fib({i}) = {fibonacci(i)}"); }
HTTP Request
let resp = http.get("https://api.github.com/repos/young-developer90/zamin");
print(resp.status);
File I/O
fs.write("hello.txt", "Hello, Zamin!");
let content = fs.read("hello.txt");
print(content);
GUI (Linux with Luna)
sudo apt install libgtk-4-dev
cargo build --release --features luna
let win = luna.Leo("App", 400, 300);
let label = luna.Label(win, "Hello from Luna!");
luna.pack(label);
let btn = luna.Button(win, "Click", func() {
luna.config(label, "text", "Clicked!");
});
luna.pack(btn);
luna.mainloop(win);
CLI
| Command | Description |
|---|---|
zamin run <file> |
Run a script |
zamin repl |
Interactive REPL |
zamin fmt <file> |
Format source code |
zamin test [filter] |
Run tests |
zamin new <name> |
Create a new project |
zamin init |
Initialize project in current dir |
zamin build |
Type-check all .zamin files |
zamin version |
Show version |
zamin-rs <file> |
Quick-run without subcommands |
Performance
Zamin's bytecode VM competes well with CPython on integer-heavy workloads, thanks to raw byte dispatch, specialized integer opcodes, and a peephole optimizer:
| Benchmark | Zamin | Python 3 | Ratio |
|---|---|---|---|
| Recursive fib(32) | 1.51s | 0.35s | 4.3x |
| Integer loop (5M ops) | 0.47s | 0.53s | 0.9x |
| String concat (100K) | 3.14s | 0.23s | 13.4x |
| List push (500K) | 0.13s | 0.09s | 1.5x |
| Overall | 5.63s | 1.18s | 4.8x |
Zamin excels at tight integer loops — often matching or exceeding CPython — but is slower on string and list operations due to the overhead of its bytecode interpreter. Benchmarks run on the same machine using time for wall-clock measurement.
Build Options
# Default (no optional features)
cargo build --release
# With OpenCV
cargo build --release --features opencv
# With Luna (Linux GUI)
cargo build --release --features luna
# With Python interop
cargo build --release --features python
License
MIT -- see LICENSE.
Dependencies
~9–44MB
~651K SLoC