Feb 2026 - Mar 2026
BrainRot Lang
A programming language built from scratch in Go, with internet slang as its syntax. It runs functions, recursion and loops through a custom parser and interpreter. A command-line runner, VS Code extension and documentation site make it possible to write and run your own programs.
- PROJECT
- Interpreted programming language
- ROLE
- Language design and implementation
- RUNTIME
- Go, tree-walking interpreter
- TOOLING
- VS Code, Next.js docs, GitHub Actions
Overview
BrainRot Lang is a programming language built in Go, with internet slang as its syntax. It runs programs with functions, recursion, arrays and loops through its own parser and interpreter.
I built the language in Go and added the tools needed to try it: a command-line runner, examples, a documentation site and a VS Code extension. The project follows a program from source text to a running result.

Why I built it
Writing application code leaves much of a language's behavior hidden. I wanted to implement the rules myself: how an expression is grouped, where a variable lives, and what happens when a function returns from inside a loop.
The meme vocabulary made the language enjoyable to demonstrate. A function starts with let_him_cook, while say_my_name prints a value. Those choices also created a reason to write examples and editor help that someone else could follow.
The problem
Recognizing a keyword is only the first step. Operators need precedence, nested blocks need scope, and control flow has to pass through the evaluator without being mistaken for an ordinary value.
Errors need a useful location too. A parser should explain where a program stopped making sense, while a runtime error should point back to the expression that caused it. The syntax tree carries line information through those stages.
The solution
The lexer turns characters into tokens. A hand-written recursive-descent parser groups those tokens into statements and expressions, with separate functions for each level of operator precedence.
The tree-walking interpreter evaluates those nodes using environments for variable lookup and updates. Function calls, recursion, arrays and loop control are handled in the runtime instead of being translated into another language.
Separate syntax from execution
The AST describes the program before the interpreter runs it. That gives parser and evaluator behavior distinct places to inspect and test.
Keep scope explicit
Enclosed environments look up values through an outer environment, while local declarations stay associated with the current scope.
Make examples executable
Programs such as Fibonacci and FizzBuzz exercise several language features together and provide a starting point for readers.

The language execution pipeline
Source text
A .brt program supplies statements and expressions.
Lexer
Characters become tokens with source locations.
Parser and AST
Precedence rules turn tokens into a syntax tree.
Interpreter
The runtime evaluates the tree using scoped environments.
Developer experience
The VS Code extension provides syntax highlighting, snippets and hover documentation. The Next.js site explains keywords and installation, and GitHub Actions automates cross-platform release builds.
These pieces matter because a new language has no familiar ecosystem to fall back on. A reader should be able to install it, run an example and understand an error without reading the interpreter's source first.


What it demonstrates
The result is an executable language with its own syntax and runtime, supported by tests and distribution tooling. It gave me a concrete way to work through parsing, scope and control flow together.
The interpreter executes the syntax tree directly, keeping the runtime close to the language rules. The command-line runner, editor extension and documentation complete the path from installing the language to writing and running a program.
Demo
BrainRot Lang walkthrough
BrainRot Lang gallery
A closer look at the product and its workflows.





