Loading...

Build your own Interpreter

Learn about tokenization, ASTs, tree-walk interpreters and more.

Start Building
interpreter
Go
interpreter
Python
interpreter
Rust
This challenge is free to try when it's in beta. We keep challenges in beta for a few weeks to gather feedback.

This challenge follows the book Crafting Interpreters by Robert Nystrom.

In this challenge you'll build an interpreter for Lox, a simple scripting language. Along the way, you'll learn about tokenization, ASTs, tree-walk interpreters and more.

Before starting this challenge, make sure you've read the "Welcome" part of the book that contains these chapters:

These chapters don't involve writing code, so they won't be covered in this challenge. This challenge will start from chapter 4, Scanning.

Stages

Scanning: Empty file
Login via GitHub to view this stage
Scanning: Parentheses
Login via GitHub to view this stage
Scanning: Braces
Login via GitHub to view this stage
Scanning: Other single-character tokens
Login via GitHub to view this stage
Scanning: Lexical errors
Login via GitHub to view this stage
Scanning: Assignment & equality Operators
Login via GitHub to view this stage
Scanning: Negation & inequality operators
Login via GitHub to view this stage
Scanning: Relational operators
Login via GitHub to view this stage
Scanning: Division operator & comments
Login via GitHub to view this stage
Scanning: Whitespace
Login via GitHub to view this stage
Scanning: Multi-line errors
Login via GitHub to view this stage
Scanning: String literals
Login via GitHub to view this stage
Scanning: Number literals
Login via GitHub to view this stage
Scanning: Identifiers
Login via GitHub to view this stage
Scanning: Reserved words
Login via GitHub to view this stage