Tango is a custom programming language with its own compiler and virtual machine, implemented in Go.
Tango is a simple language that supports:
- Variable declarations
- Arithmetic operations
- Boolean operations
- Print statements
let a = 1;
let b = a + 2;
let c = (b - 5) * 3 / 4 + 2;
print c;
let x = true;
let y = !x;
print y;
lexer/- Tokenizes the source codeparser/- Parses tokens into an abstract syntax tree (AST)ast/- Abstract syntax tree definitionscompiler/- Compiles AST into bytecodebytecode/- Bytecode definitions and utilitiesvm/- Virtual machine that executes bytecodetoken/- Token type definitionsrepl/- Read-Eval-Print Loop for interactive executioncmd/- Command-line tools
go run cmd/tango/main.go run test.tangoOr using npm scripts:
npm run rungo run cmd/tango/main.go compile test.tangoOr using npm scripts:
npm run gen:bytecodenpm run buildnpm testMIT