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

FeatureDescription
Variableslet and const declarations with type inference
FunctionsNamed functions, arrow functions, closures, default parameters
ClassesInheritance, constructors, methods, this binding
Control Flowif/else, while, for..in, match/when, break, continue
Data TypesNumbers, strings, booleans, null, arrays, objects
OperatorsArithmetic, comparison, logical, string concatenation, power (**), conditional (cond ? a : b)
Modulesimport statements for code organization
TestingBuilt-in test blocks with assertion functions
Ranges0..10 syntax for numeric ranges

Complete Toolchain

ToolCommandDescription
Runtinylang runExecute source files with the tree-walk interpreter
Compiletinylang compileCompile to optimized bytecode (.tinyc)
Executetinylang execRun compiled bytecode on the VM
Debugtinylang debugInteractive step debugger with breakpoints
Formattinylang fmtAuto-format source code
Linttinylang lintStatic analysis with auto-fix
Testtinylang testRun test suites with built-in test runner
REPLtinylang replInteractive read-eval-print loop