Reimplementation of the Lox programming language.
Crafting interpreters book by Robert Nystrom explains how to implement the Lox programming language from scratch. This is my own implementation here written in the Rust programming lanugage.
The Lox programming language:
- is a scripting language
- shares C-like syntax
- is dynamically typed
- is garbage collected
More description in the book.
- Tree-walk interpreter
- Scanning
- Parsing
- Evaluating
- Intermediate representation
- Optimization
- Code generation
- Virtual machine
- Runtime
- A Tree-Walk Interpreter
- Scanning text source code into lexems
- Representing Code in syntax tree
- Parsing expression with hand-written recursive descent parser
- Evaluating expression with bare-bones intepreter
- Statements and State
- Control Flow
- Functions
- Resolving and Binding
- Classes
- Inheritance
- A Bytecode Virtual Machine
- Chunks of Bytecode
- A Virtual Machine
- Scanning on Demand
- Compiling Expressions
- Types of Values
- Strings
- Hash Tables
- Global Variables
- Local Variables
- Jumping Back and Forth
- Calls and Functions
- Closures
- Garbage Collection
- Classes and Instances
- Methods and Initializers
- Superclasses
- Optimization