abesto / clox-rs

Following along the second (C) part of https://craftinginterpreters.com/, but with Rust, because reasons.

Home Page:https://abesto.github.io/clox-rs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clox-rs

Following along the second (C) part of https://craftinginterpreters.com/, but with Rust, because reasons.

Status: done!

Check it out running in your browser: https://abesto.github.io/clox-rs/

Check out NOTES.md for a ton of details, especially around differences vs. clox as a result of using Rust.

Performance

On fib(30), about 4x slower than clox. Most of the overhead comes from explicit (safe) memory management using an arena, as opposed to the manual memory management of clox. See NOTES.md for lots of measurments and a breakdown of various optimizations applied.

Correctness

  • Running with --std, clox-rs passes the complete test-suite of clox
  • There's also a small custom test-suite to verify non---std behavior (challenge solutions and some more informative output)
  • make test executes both, with and without GC stress-testing (forced GC after each instruction)

About

Following along the second (C) part of https://craftinginterpreters.com/, but with Rust, because reasons.

https://abesto.github.io/clox-rs/


Languages

Language:Rust 85.6%Language:HTML 10.2%Language:SCSS 2.1%Language:Makefile 1.1%Language:JavaScript 1.0%