TinyLang Documentation
A complete educational programming language with interpreter, bytecode compiler, virtual machine, debugger, formatter, linter, and more.
Interpreter
Bytecode Compiler
Virtual Machine
Debugger
Formatter
Linter
Test Runner
Web IDE
Module System
60+ Stdlib Functions
Hello, TinyLang!
// Your first TinyLang program
let name = "World"
print("Hello, " + name + "!")
// Functions with closures
fn makeGreeter(greeting) {
return (name) => greeting + ", " + name + "!"
}
let hi = makeGreeter("Hi")
print(hi("TinyLang")) // Hi, TinyLang!
Explore
Language Features
| Feature | Description |
|---|---|
| Variables | let and const declarations with type inference |
| Functions | Named functions, arrow functions, closures, default parameters |
| Classes | Inheritance, constructors, methods, this binding |
| Control Flow | if/else, while, for..in, match/when, break, continue |
| Data Types | Numbers, strings, booleans, null, arrays, objects |
| Operators | Arithmetic, comparison, logical, string concatenation, power (**), conditional (cond ? a : b) |
| Modules | import statements for code organization |
| Testing | Built-in test blocks with assertion functions |
| Ranges | 0..10 syntax for numeric ranges |
Complete Toolchain
| Tool | Command | Description |
|---|---|---|
| Run | tinylang run | Execute source files with the tree-walk interpreter |
| Compile | tinylang compile | Compile to optimized bytecode (.tinyc) |
| Execute | tinylang exec | Run compiled bytecode on the VM |
| Debug | tinylang debug | Interactive step debugger with breakpoints |
| Format | tinylang fmt | Auto-format source code |
| Lint | tinylang lint | Static analysis with auto-fix |
| Test | tinylang test | Run test suites with built-in test runner |
| REPL | tinylang repl | Interactive read-eval-print loop |