🚀 No installation required — try Zamin right now in your browser: Playground → I've spent the last several months building Zamin, a scripting language with a Rust-based interpreter, a register-based bytecode VM, and a mark-and-sweep garbage collector. I wanted to share it here and get feedback from people who actually build languages and runtimes. 🔗 Repo: https://github.com/young-developer90/zamin (MIT licensed) 🎮 Playground: https://young-developer90.github.io/zamin/playground.html 📚 Docs: https://young-developer90.github.io/zamin/ If you only click one link in this post, make it the playground — the entire interpreter runs client-side via WebAssembly, so you can write and run real Zamin code in about 5 seconds with zero setup. ⚡ Why another scripting language? I wanted something in the same territory as Python for everyday scripting -- closures, pattern matching, string interpolation, a real module system -- but compiled to bytecode instead of tree-walked, with a project/CLI toolchain built in from day one rather than bolted on later. func fibonacci(n) { if n parser -> AST -> compiler -> bytecode -> VM. A few things I focused on: Register-based VM with raw byte dispatch (computed gotos on GCC/Clang) instead of a stack machine or a function-pointer dispatch table -- this alone was a 15-25% win across the board. Specialized integer opcodes (e.g. OP_ADD_INT_IMM) that skip boxing and type checks for the common case. Generational, non-moving, incremental mark-and-sweep GC to keep pause times low. Peephole optimizer: constant folding, dead code elimination, strength reduction, jump threading, opcode merging. 📊 Benchmarks vs Python 3 Wall-clock, same machine: Benchmark Zamin Python 3 Ratio Recursive fib(32) 1.51s 0.35s 4.3x slower Integer loop (5M ops) 0.47s 0.53s 🏆 0.9x -- faster than Python String concat (100K) 3.14s 0.23s 13.4x slower List push (500K) 0.13s 0.09s 1.5x slower Tight integer loops are Zamin's strongest case. String and list-heavy code still lags CPython -- that's an open problem I'm actively working on, not something I'm hiding. 🧩 What's built in ✅ 25+ stdlib modules available globally with no import (math, string, fs, json, re, http, csv, datetime, stats, hashlib, logging, subprocess, path, collections, itertools, test, rand, matrix, and more) 🖥️ Two feature-gated GUI toolkits: luna (Linux/GTK4) and sol (Windows) 📷 OpenCV bindings via the cv module 🧠 A GPU-accelerated numerical module (linum) with a small PyTorch-style API -- Sequential, Linear, Adam, CrossEntropyLoss -- that runs against CUDA when available 🔌 C extension ABI for native modules, plus Python interop (py.import("numpy") with automatic type marshalling) 🦀 An embedding API for calling Zamin from Rust (zamin::execute_source, zamin::execute_file) 🧰 A built-in LSP server + VS Code extension ⚙️ A full CLI: zamin run, zamin repl, zamin fmt, zamin test, zamin build, zamin new 🌐 The whole interpreter also compiles to WebAssembly -- there's a browser playground with zero install 🎮 Try it in 5 seconds (seriously, no install) young-developer90.github.io/zamin/playground.html Type code, hit run, see output. That's it. 💻 Or run it locally git clone https://github.com/young-developer90/zamin.git cd zamin cargo build --release ./target/release/zamin run examples/hello.zamin Enter fullscreen mode Exit fullscreen mode Requires Rust 1.80+. Docs (with a getting-started guide, full language reference, and stdlib reference) are at https://young-developer90.github.io/zamin/ -- also translated into Farsi and Japanese. I'd genuinely appreciate feedback, especially on the VM design and where the string/list performance gap is likely coming from. If you try the playground, let me know what you build with it 🙂 Happy to answer questions in the comments.
Zamin: A Scripting Language with a Rust-Based Bytecode VM and GPU-Accelerated ML
Full Article
Original Source
Read the full article at Dev →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.