~/projects/betty

Betty Programming Language

A fully interpreted programming language designed and implemented from scratch in C# — hand-written lexer and parser, first-class functions, closures, and 300+ unit tests.

c# interpreter

What it is

Betty is a fully-featured interpreted programming language I designed and implemented from scratch in C#. It exists to scratch a specific itch: I wanted to build a language end to end — lexer, parser, evaluator, standard library — without leaning on parser generators or borrowed runtimes.

What’s in it

  • Hand-written lexer and parser. No ANTLR, no PEG.js — every token boundary and grammar rule is mine.
  • Multiple data types — integers, floats, strings, booleans, lists, dictionaries.
  • First-class functions, lambda expressions, and closures.
  • Built-in standard library for common operations.

Why it matters to me

It’s the kind of project that forces you to internalize how programming languages actually work. Every feature you’ve ever taken for granted — variable scoping, closures, function dispatch — has an implementation cost, and writing those costs yourself is the cheapest way to learn what they really are.

Quality bar

The interpreter ships with a comprehensive xUnit test suite (300+ tests) covering lexer behavior, parser correctness, evaluator semantics, and edge cases. The website at betty-lang.org documents the language’s features with worked examples.

← Back to projects