https://github.com/chamons/rusty-lox
Working through https://craftinginterpreters.com in rust
https://github.com/chamons/rusty-lox
Last synced: 14 days ago
JSON representation
Working through https://craftinginterpreters.com in rust
- Host: GitHub
- URL: https://github.com/chamons/rusty-lox
- Owner: chamons
- License: mit
- Created: 2021-10-12T18:42:44.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-19T20:24:15.000Z (about 1 year ago)
- Last Synced: 2025-01-20T14:55:18.087Z (12 months ago)
- Language: Rust
- Size: 164 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rusty-lox
This is an implementation of lox in rust through chapter 24 of [the book](https://craftinginterpreters.com/functions.html).
It contains:
- User declared functions, with recursion
- Built in timing function
- Basic addition and order of operation
with a bytecode compiler from the book ported from C to Rust.
## Show Me
```
% cat data/fib.lox
fun fib(n) {
if (n < 2) return n;
return fib(n - 2) + fib(n - 1);
}
var start = clock();
print fib(35);
print clock() - start;
% cargo run -q --release -- data/fib.lox
9227465
3.6996841430664063
```