4 ms·
Nice article. A couple of years ago I also implemented Lox in Rust. And I faced the exact same issues that the author describes here, and I also ended up with a
by ceronman 2y ago
Nice article. A couple of years ago I also implemented Lox in Rust. And I faced the exact same issues that the author describes here, and I also ended up with a very similar implementation.
I also wrote a post about it: https://ceronman.com/2021/07/22/my-experience-crafting-an-interpreter-with-rust/ https://ceronman.com/2021/07/22/my-experience-crafting-an-in...
I ended up having two implementations: One in purely safe Rust and another one with unsafe.
Note that if you're interesting in the "object manager" approach mentioned, I did that in my safe implementation, you can take a look at https://github.com/ceronman/loxido https://github.com/ceronman/loxido
- ltungv 2y agoI'd read your article, and it was lovely. It nudged me to just go unsafe and implement some of the data structures from scratch.