https://github.com/rami3l/dolores
A tree-walking interpreter for the Lox Programming Language.
https://github.com/rami3l/dolores
crafting-interpreters interpreter lox lox-language programming-language rust rust-lang
Last synced: 5 months ago
JSON representation
A tree-walking interpreter for the Lox Programming Language.
- Host: GitHub
- URL: https://github.com/rami3l/dolores
- Owner: rami3l
- Created: 2021-11-29T21:36:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-19T00:22:39.000Z (over 2 years ago)
- Last Synced: 2025-05-13T00:05:11.014Z (10 months ago)
- Topics: crafting-interpreters, interpreter, lox, lox-language, programming-language, rust, rust-lang
- Language: Rust
- Homepage:
- Size: 266 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dolores
> "... light of my life."
[The Lox Programming Language](https://www.craftinginterpreters.com/the-lox-language.html) implemented in Rust.
Ported from the original Java-based `jlox` tree-walking interpreter\*, but with no visitor patterns, no `null` values, no subclasses and implicit conversions, just pure `enum`s.
~~`Gc` is a necessary evil...~~
\* : For the bytecode VM interpreter, see [`rami3l/golox`](https://github.com/rami3l/golox).
---
## Contents
- [dolores](#dolores)
- [Contents](#contents)
- [Features](#features)
- [Try it out!](#try-it-out)
---
## Features
- [x] Lexer
- [x] Parser
- [x] Basic types
- [x] Floating point arithmetic
- [x] Logic expressions
- [x] Control flow
- [x] Jumps: `break`/`continue`\*\*
- [x] Semantic analysis: jumping out of loops
- [x] Functions
- [x] Lambdas\*\*
- [x] Semantic analysis: returning out of functions
- [x] Semantic analysis: static closure captures
- [x] Classes
- [x] Instances
- [x] Instance methods
- [x] `this`
- [x] Semantic analysis: `this` out of classes
- [x] Initializers
- [x] Semantic analysis: `return`ing values in initializers
- [x] Inheritance
- [x] `super`
- [x] Semantic analysis: `super` out of subclasses
\*\* : Extension
## Try it out!
With the latest [Rust toolchain](https://www.rust-lang.org/tools/install) installed, just execute:
```bash
cargo run
```