A procedural programming language that compiles to NVM bytecode. Nest is designed to be simple, explicit, and practical.
proc main() {
var n = 10;
var i = 0;
while (i < n) {
if (i % 2 == 0) {
print("even: ");
} else {
print("odd: ");
}
print(str(i) + "\n");
i = i + 1;
}
}
/* ^^^^^
* Pseudo-code. If you looking for real samples, go to ./samples/
*/
| Feature | Status |
|---|---|
print() built-in |
✅ |
| Integers, strings, booleans | ✅ |
Variables (var x = 5) |
✅ |
Arithmetic (+ - * / %) |
✅ |
Comparisons (< > <= >= == !=) |
✅ |
Logical operators (&& || !) |
✅ |
if / else |
✅ |
while loops |
✅ |
Functions (proc name(args) {}) |
✅ |
| Recursion | ✅ |
return |
✅ |
| Local variables | ✅ |
forloopsbreak/continue- Arrays
- File I/O (
open,read,write,close) - Built-in:
len(),int(),str()
See scripts/install.sh
nest-lang
├── src/
│ ├── main.rb # Driver
│ ├── lexer.rb # Tokenizer
│ ├── parser.rb # AST builder
│ ├── codegen.rb # NVM assembly generation
│ └── lib/
│ └── reporter.rb # Error reporting lib
├── samples/ # Example programs
└──tools/
└── disasm.rb # NVM binary disassembler
proc pyramid(n, max) {
if (n <= max) {
var i = 0;
while (i < n) {
print("*");
i = i + 1;
}
print("\n");
pyramid(n + 1, max);
}
}
proc main() {
pyramid(1, 6);
}
- No classes, inheritance, or OOP
- No generics
- No exceptions
GPL-3.0 — because sharing is caring.