Crusty Interpreter
Course description
Course Description. In brief: you are challenged to implement an interpreter for a programming language unfamiliar to you (Lox) using a language you may also not have worked with (Rust), based on a book written in a language many once knew (Java).
Read more about the course
General Overview
Sometimes at university, there were courses where the instructor would give out a modest assignment like "design the architecture of a processor's instruction set," "implement a Unix shell from scratch," or "solve the Dirac equation" on the very first day. Some students would try to run away, while others would smile as if to say, "go ahead, give it a try." This course falls into that same category.
Starting from scratch, you will dive into Robert Nystrom's book "Crafting Interpreters" and be tasked with implementing a lexer and a recursive descent parser — and this will be your first experience with Rust. The difficulty only escalates from there.
Target Audience
The course is designed for experienced developers who want to enhance their skills by working on a meaningful and intensive project using a modern programming language. Perhaps you recognize yourself in one of these descriptions:
- You have written a bit in Rust and want to move beyond simple examples by tackling a project with multiple components.
- You have never worked with Rust, but you are curious. You have experience creating interpreters or compilers, and you are confident you can dive into deep waters.
- You have never written in Rust or worked on interpreters at all, but you have a whole week, no other commitments, and the desire to take on a serious challenge.
The course is truly challenging, like a marathon: during the process, you'll find yourself thinking "what have I gotten myself into?" but finishing will bring genuine satisfaction.
Learning Format
This is a week-long project-intensive course. Each morning begins with discussions on topics related to programming language design and their implementation in Rust. Most of the time is dedicated to independent code work. Throughout the day, there will be short sessions to address problems and share experiences.
Prerequisites
Confidence in basic programming language concepts is required: expressions, operators, variables, control flow, functions, and classes. Experience in implementing an interpreter in any language is useful but not mandatory. Knowledge of Rust is not assumed, but you must be ready for a very fast-paced learning experience. Rust is a challenging language, so expect a lot of trial and error initially.
Curriculum
The main goal is to cover the first ten chapters of the book "Crafting Interpreters," creating an AST-walking interpreter for the Lox language. Key aspects of programming language implementation will be studied in the process:
- Scanning and lexical analysis.
- Parsing using recursive descent.
- Program representation and AST construction.
- Program execution.
- Variables, scope, and environment.
- Control structures (if, while, for).
- Functions, including higher-order functions and closures.
Simultaneously, you'll get acquainted with important aspects of Rust development:
- Project organization across multiple modules.
- Working with strings.
- Error handling and using Option/Result.
- Testing.
- Algebraic data types (struct, enum).
- Recursive structures (trees, lists).
- Pattern matching.
- Ownership and borrowing rules.
- Interior mutability.
The book provides all necessary code snippets, but they are written in Java and often use idioms that do not have direct analogs in Rust. A significant part of the challenge lies in understanding the concept and implementing it correctly. This, however, makes course discussions particularly productive.
Watch Online
All Course Lessons (11)
| # | Lesson Title | Duration | Access |
|---|---|---|---|
| 1 | 001 Day 1 Morning Demo | 03:31:34 | |
| 2 | 002 Day 1 Afternoon | 03:23:52 | |
| 3 | 003 Day 2 Morning | 01:27:36 | |
| 4 | 004 Day 2 Late-Morning | 01:51:41 | |
| 5 | 005 Day 2 Afternoon | 03:21:43 | |
| 6 | 006 Day 3 Morning | 03:34:18 | |
| 7 | 007 Day 3 Afternoon | 03:25:26 | |
| 8 | 008 Day 4 Morning | 03:17:33 | |
| 9 | 009 Day 4 Afternoon | 03:34:20 | |
| 10 | 010 Day 5 Morning | 03:39:56 | |
| 11 | 011 Day 5 Afternoon | 02:45:11 |
Unlock unlimited learning
Get instant access to all 10 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.
Learn more about subscriptionComments
0 commentsWant to join the conversation?
Sign in to commentSimilar courses
Ultimate Rust Crash Course
Learn Rust in a Month of Lunches
Rust for Beginners
Ultimate Rust Best Practices