JohnIrle / crafting-interpreters-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crafting Interpreters in Rust

This is an in progress project aiming to implement both versions of the Lox Language from the book Crafting Interpreters in Rust.

Progress

  • Chapter 1: Introduction
  • Chapter 2: A Tree-Walk Interpreter
  • Chapter 3: The Lox Language
  • Chapter 4: Scanning
  • Chapter 5: Representing Code
  • Chapter 6: Parsing Expressions
  • Chapter 7: Evaluating Expressions
  • Chapter 8: Statements and State
  • Chapter 9: Control Flow
  • Chapter 10: Functions
  • Chapter 11: Resolving and Binding
  • Chapter 12: Classes
  • Chapter 13: Inheritance
  • Chapter 14: Chunks Of Bytecode

Things I've learned so far

  • How to implement an approximation of abstract classes and the visitor pattern in Rust using traits, generics and enums. Here and Here
  • How to generate a source file by mapping over a grammar configuration. Here
  • Scanning text to produce tokens. Here
  • Parsing tokens to produce an abstract syntax tree for expressions. Here
  • Enums in C are represented as integer constants.

About

License:MIT License


Languages

Language:Rust 100.0%