
I built YO — an interpreted language that reads like English, with a VS Code extension, playground, and PyPI package
Hey r/pythonhelp ,
I'm a final-year CS student, and over the past few months I've been building YO, a small interpreted programming language written from scratch in Python.
The original goal was to learn how interpreters work by implementing my own lexer, parser, and interpreter. As the project evolved, I became interested in one specific question:
Can compiler/interpreter error messages actively teach beginners instead of simply reporting what's wrong?
I'm not claiming YO is a replacement for Python, JavaScript, or any established language. It has no ecosystem, and it's implemented as a tree-walk interpreter, so performance isn't the goal.
Instead, I focused on making diagnostics more educational.
Example
Python:
"hello" - 5
TypeError: unsupported operand type(s) for -: 'str' and 'int'
YO:
say "hello" - 5
❌ [E003] Type Mismatch
Can't use '-' between String and Int.
"hello" is text.
5 is a number.
Fix:
Use text.str(5) if you intended to concatenate.
Example:
"hello" + text.str(5)
Another example:
❌ [E001] 'scroe' was used but never made.
Did you mean 'score'?
Fix:
Create it first using:
make score = ...
Technical implementation
- Handwritten lexer
- Recursive descent parser
- Tree-walk interpreter
- Lexical scoping and closures
- Multi-error reporting (reports multiple diagnostics instead of stopping at the first error)
- Error codes with
yo explain E001for detailed explanations - Standard libraries for math, text, and lists
- 27 automated tests with GitHub Actions CI
Small informal study
I also ran a small informal comparison with 10 first-time programmers.
Both groups received the same program containing three bugs. One group used Python, while the other used YO.
The YO group fixed the bugs faster on average.
The sample is small and not intended as rigorous research, but I included the methodology, raw results, and limitations in the repository for anyone interested.
Try it
→ GitHub
→ pip install yo-lang PyPI
→ VS Code extension search "YO Language" on the Marketplace
→ Browser playground (no install): Playground
I'm especially interested in feedback from people who have built interpreters or compilers.
Do you think "errors that teach" is an area worth exploring in language design, or is it mainly valuable only for complete beginners?
I'd also be happy to answer questions about the lexer, parser, interpreter architecture, or implementation decisions.