TinyPanda Interpreter

A toy interpreted programming language written in Go.

Overview

TinyPanda is an interpreted programming language written in Go, with support for variables, functions, loops, operators, built-in functions, and multiple data types.

It also includes a web playground where TinyPanda programs can be written and executed directly in the browser.

Implementation

The interpreter follows the lexer → parser → AST → evaluator pipeline.

I extended the language with:

  • for and loop statements
  • Increment and decrement operators
  • Ternary operators
  • Floating-point values
  • Escape characters and comments
  • Additional built-in functions
  • Type conversion, string, math, and time/date utilities

The web playground runs the Go interpreter through WebAssembly, allowing programs to be executed directly in the browser.

TinyPanda playground execution pipeline

The diagram above shows how a TinyPanda program moves from the playground through the WebAssembly runtime and interpreter before returning the result.

What I Learned

Working on this helped me understand how lexers, parsers, ASTs, and evaluators work together to execute a program.

I also gained experience extending a language with new syntax and running a Go-based interpreter in the browser using WebAssembly.