Skip to content

nivekithan/tango

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tango Programming Language

Tango is a custom programming language with its own compiler and virtual machine, implemented in Go.

Overview

Tango is a simple language that supports:

  • Variable declarations
  • Arithmetic operations
  • Boolean operations
  • Print statements

Example

let a = 1;
let b = a + 2;
let c = (b - 5) * 3 / 4 + 2;
print c;

let x = true;
let y = !x;
print y;

Project Structure

  • lexer/ - Tokenizes the source code
  • parser/ - Parses tokens into an abstract syntax tree (AST)
  • ast/ - Abstract syntax tree definitions
  • compiler/ - Compiles AST into bytecode
  • bytecode/ - Bytecode definitions and utilities
  • vm/ - Virtual machine that executes bytecode
  • token/ - Token type definitions
  • repl/ - Read-Eval-Print Loop for interactive execution
  • cmd/ - Command-line tools

Usage

Running a Program

go run cmd/tango/main.go run test.tango

Or using npm scripts:

npm run run

Compiling a Program

go run cmd/tango/main.go compile test.tango

Or using npm scripts:

npm run gen:bytecode

Building the Executable

npm run build

Running Tests

npm test

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages