A high-performance bytecode programming language and stack-based virtual machine written in native Go.
let fib = fn(n) {
if (n <= 1) {
return n;
}
return fib(n - 1) + fib(n - 2);
};
let result = fib(10);
print("fib(10) =", result);
- Native Binary: Compiles to a single standalone executable (
rune.exe/rune) with zero external runtime dependencies. - Pratt Parser: Top-down operator precedence climbing parser for expressions and control flow.
- Stack-Based Virtual Machine: Compact bytecode instructions (
OpConstant,OpAdd,OpJump,OpCall,OpClosure, etc.). - Lexical Scoping & Closures: Full closure upvalue capture with free variable resolution.
- Data Structures: First-class arrays
[1, 2, 3]and hash maps{"key": "value"}. - Interactive REPL: Live terminal shell with syntax coloring and dynamic disassembler.
irm https://raw.githubusercontent.com/yanzyuyu/rune/main/install.ps1 | iexcurl -fsSL https://raw.githubusercontent.com/yanzyuyu/rune/main/install.sh | bashgo install github.com/yanzyuyu/rune/cmd/rune@latestrunerune run script.rnrune disasm script.rnlet x = 10;
const PI = 3.14159;
let makeMultiplier = fn(factor) {
return fn(x) {
return x * factor;
};
};
let double = makeMultiplier(2);
print(double(21)); // 42
if (x > 0) {
print("positive");
} else {
print("non-positive");
}
let list = [1, 2, 3];
let item = first(list);
let extended = push(list, 4);
let person = {"name": "Rune", "version": 1};
let name = person["name"];
MIT