dlox

An implementation of the Lox language in Dart.

Lox is a didactic language as proposed in the book Crafting Interpreters. In the first part of the book, the autor guides the reader in the process of making an interpreter for the Lox language in Java.

This is a Dart adaptation of the proposed Java code for fun and for learning. Although most of the implementation is near identical to the Java one, there are some adaptations that I chose to made and some simplifications that the Dart language allowed me to do.

After I implement all the proposed code in the book (i.e. up to chapter 13), I am going to implement some of the challenges that the author left, as an extra, and maybe even some personal changes, as long as they don't break the base Lox language. Thus, this can be viewed as a superset of Lox.

Roadmap

Book roadmap

  • x Scanner (Chapter 4)
  • x Basic code representation, visitors (Chapter 5)
  • x Expressions (Chapter 6, 7)
  • Statements (Chapter 8)
  • Control Flow (Chapter 9)
  • Functions (Chapter 10)
  • Resolving and Binding (Chapter 11)
  • Classes (Chapter 12)
  • Inheritance (Chapter 13)

Challenges

  • Multiline comments (Chapter 4, challenge 4)

Libraries

dlox