Pika Language Interpreter
tree-walking interpreter for a small dynamically typed language, written in go from scratch. built to actually understand parsing and evaluation.
Pika is a tree-walking interpreter for a small dynamically typed language, written in Go from scratch. Built following Thorsten Ball's Writing An Interpreter In Go — no parser generator, no library shortcuts, every layer hand-rolled.
Related writing: i built my own interpreter and it's kinda cool.

why build a language
"How does a programming language work?" is one of those questions that has confident answers everywhere on the internet and somehow still feels like a black box until you write one. Building a tiny one demystifies the whole stack: lexing, parsing, evaluation, scope, closures.
what's implemented
A complete lexer, parser, and tree-walking evaluator supporting:
- Math and comparison expressions with the standard operators (
+,-,*,/,<,>,==,!=) letbindings with proper lexical scoping- First-class functions with closures and higher-order patterns
- Conditionals with
if/elseexpressions and explicitreturn - Data types: integers, booleans, strings, arrays, hash maps
- Built-ins:
len,first,last,rest,push
javascriptlet makeCounter = fn() { let count = 0; return fn() { count = count + 1; return count; }; }; let counter = makeCounter(); counter(); // 1 counter(); // 2
what i learned
The interpreter itself is the easy part once you have a clean AST. The hard problem is parsing — every weird thing about precedence, associativity, and ambiguity in real languages is a parser problem in disguise. After this project, reading a language spec stopped feeling like reading magic.