Skip to content

WenzeJin/rlox

Repository files navigation

rlox: Lox Interpreter / REPL in Rust

Rust Build & Test

rlox is a Rust implementation of the Lox programming language, as described in the book Crafting Interpreters. It includes a REPL (Read-Eval-Print Loop) and the ability to execute Lox scripts.

Features

  • A fully functional Lox interpreter written in Rust.
  • Support for both interactive REPL and script execution.
  • Implements the Lox language as described in Crafting Interpreters.
  • Easy to build, run, and test using cargo.
  • Well tested with unit tests and integration tests.
  • Will support List and Map

Usage

Running the REPL

To start the interactive REPL:

./rlox

Running a Lox Script

To execute a Lox script:

./rlox <script>

Installation

  1. Clone the repository:

    git clone https://github.com/WenzeJin/rlox.git
    cd rlox
  2. Build the project:

    cargo build --release
  3. Run the REPL or a script as described in the Usage section.

How to Build & Run

To build the project in release mode:

cargo build --release

To build and run the project:

cargo run

How to Test

Run the test suite using cargo:

cargo test

Contributing

Contributions are welcome! If you'd like to contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Submit a pull request with a clear description of your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Note

Copyright (c) 2025 Wenze Jin

About

Lox Interpreter / REPL in Rust

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages