{"slug": "zamin-a-scripting-language-with-a-rust-based-bytecode-vm-and-gpu-accelerated-ml", "title": "Zamin: A Scripting Language with a Rust-Based Bytecode VM and GPU-Accelerated ML", "summary": "A developer built Zamin, a scripting language with a Rust-based interpreter, register-based bytecode VM, and mark-and-sweep garbage collector. The language features closures, pattern matching, string interpolation, and a module system, with a built-in CLI toolchain. Benchmarks show Zamin outperforms Python in tight integer loops but lags in string and list-heavy code.", "body_md": "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.\n\nRepo: [https://github.com/young-developer90/zamin](https://github.com/young-developer90/zamin) (MIT licensed)\n\nI 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.\n\n```\nfunc fibonacci(n) {\n    if n <= 1 { return n; }\n    return fibonacci(n - 1) + fibonacci(n - 2);\n}\nfor i in 0..10 { print(f\"fib({i}) = {fibonacci(i)}\"); }\n```\n\nThe pipeline is fairly conventional: lexer -> parser -> AST -> compiler -> bytecode -> VM. A few things I focused on:\n\n`OP_ADD_INT_IMM`\n\n) that skip boxing and type checks for the common case.Benchmarked against Python 3 (wall-clock, same machine):\n\n| Benchmark | Zamin | Python 3 | Ratio |\n|---|---|---|---|\n| Recursive fib(32) | 1.51s | 0.35s | 4.3x slower |\n| Integer loop (5M ops) | 0.47s | 0.53s | 0.9x -- faster than Python |\n| String concat (100K) | 3.14s | 0.23s | 13.4x slower |\n| List push (500K) | 0.13s | 0.09s | 1.5x slower |\n\nTight 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.\n\n`luna`\n\n(Linux/GTK4) and `sol`\n\n(Windows)`cv`\n\nmodule`linum`\n\n) with a small PyTorch-style API -- `Sequential`\n\n, `Linear`\n\n, `Adam`\n\n, `CrossEntropyLoss`\n\n-- that runs against CUDA when available`py.import(\"numpy\")`\n\nwith automatic type marshalling)`zamin::execute_source`\n\n, `zamin::execute_file`\n\n)`zamin run`\n\n, `zamin repl`\n\n, `zamin fmt`\n\n, `zamin test`\n\n, `zamin build`\n\n, `zamin new`\n\n```\ngit clone https://github.com/young-developer90/zamin.git\ncd zamin\ncargo build --release\n./target/release/zamin run examples/hello.zamin\n```\n\nRequires Rust 1.80+.\n\nDocs (with a getting-started guide, full language reference, and stdlib reference) are at [https://young-developer90.github.io/zamin/](https://young-developer90.github.io/zamin/) -- also translated into Farsi and Japanese.\n\nI'd genuinely appreciate feedback, especially on the VM design and where the string/list performance gap is likely coming from. Happy to answer questions in the comments.", "url": "https://wpnews.pro/news/zamin-a-scripting-language-with-a-rust-based-bytecode-vm-and-gpu-accelerated-ml", "canonical_source": "https://dev.to/artin9094/zamin-a-scripting-language-with-a-rust-based-bytecode-vm-and-gpu-accelerated-ml-2f5m", "published_at": "2026-07-19 08:46:47+00:00", "updated_at": "2026-07-19 09:00:49.643466+00:00", "lang": "en", "topics": ["developer-tools", "machine-learning", "artificial-intelligence"], "entities": ["Zamin", "Rust", "Python", "CUDA", "PyTorch", "GTK4", "Windows", "Linux"], "alternates": {"html": "https://wpnews.pro/news/zamin-a-scripting-language-with-a-rust-based-bytecode-vm-and-gpu-accelerated-ml", "markdown": "https://wpnews.pro/news/zamin-a-scripting-language-with-a-rust-based-bytecode-vm-and-gpu-accelerated-ml.md", "text": "https://wpnews.pro/news/zamin-a-scripting-language-with-a-rust-based-bytecode-vm-and-gpu-accelerated-ml.txt", "jsonld": "https://wpnews.pro/news/zamin-a-scripting-language-with-a-rust-based-bytecode-vm-and-gpu-accelerated-ml.jsonld"}}