a personal go implementation of the lox interpreter from crafting interpreters by robert nystrom.
built for learning, not for production.
current read: chapter 11
a peak interest in practicing go whilst revisiting the concepts of compilers and interpreters
- scanning - tokenizes lox source into tokens (strings, numbers, keywords, operators)
- parsing - recursive descent parser that builds an AST from tokens
- evaluating - tree-walk interpreter that executes the AST
- variables -
vardeclarations, assignment, block scoping with{ } - control flow -
if/else,while,forloops, logicaland/or - functions - first-class functions, closures, recursion,
return - static analysis - resolver pass for correct scope binding + compile-time error detection
- native functions -
clock()bridging go to lox - extras -
%modulo operator, comma expressions
# run a file
go run main.go test/phase4.lox
# or the repl
go run main.go- classes and inheritance (chapters 12-13)
- test suite
- language extensions (arrays, lambdas, string methods)
- stdlib (file i/o, http, json)
