https://github.com/abesto/clox-rs
Following along the second (C) part of https://craftinginterpreters.com/, but with Rust, because reasons.
https://github.com/abesto/clox-rs
lox rust
Last synced: about 1 year ago
JSON representation
Following along the second (C) part of https://craftinginterpreters.com/, but with Rust, because reasons.
- Host: GitHub
- URL: https://github.com/abesto/clox-rs
- Owner: abesto
- Created: 2022-10-02T10:57:33.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-11T17:52:50.000Z (over 3 years ago)
- Last Synced: 2025-03-15T06:52:46.673Z (over 1 year ago)
- Topics: lox, rust
- Language: Rust
- Homepage: https://abesto.github.io/clox-rs/
- Size: 8.43 MB
- Stars: 17
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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`](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`](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)