(Re)writing an interpreter in Rust - Danny van Kooten
The thing works and is pretty fast, but I remember a lot of frustration dealing with segfaults or hard-to-track down memory leaks as soon as I introduced heap allocated values. Much of this is undoubtedly due to me not being very experienced with C. But, and I know this for a fact now, it's also because C makes it very easy for issues like this to pop-up at all. One of my long-time friends has been working hard on a fast multi-threaded DataFrame library in Rust. I wanted to contribute something so started working on a CLI interface for it. Working my way through the codebase made me realise that if I wanted to contribute in a more significant way, I had to first work on my Rust skills. I was already comfortable enough with Rust to solve Advent of Code puzzles, but I had yet to really get in a good fight with the borrow checker. I needed a bigger project to really get rusty. What better way to practice than to build an interpreter? It's fun and you can really go crazy trying to make it
(Re)writing an interpreter in Rust Published by Danny van Kooten on November 17, 2022 . Permalink Two years ago I wrote my first interpreter for a toy programming language called Monkey, in C. It works and is pretty fast, but I remember plenty of frustration with segfaults and hard-to-track-down memory leaks as soon as I introduced heap-allocated values. Much of that was undoubtedly because I was not very experienced with C. But, and I know this for a fact now, it was also because C makes it very easy for issues like this to pop up. Rewrite it in Rust One of my long-time friends has been worki
Explore this link on the map →saved by
related reading
- Beating the fastest lexer generator in Rustalic.dev
- A half-hour to learn Rustfasterthanli.me
- Rust Language Cheat Sheetcheats.rs
- abseil / Performance Hintsabseil.io
- Adrian Sampson: Flattening ASTs (and Other Compiler Data Structures)cs.cornell.edu
- Rewriting Bun in Rust | Bun Blogbun.com
- Rust Optimization.md · GitHubgist.github.com
- What is Ownership? - The Rust Programming Languagedoc.rust-lang.org
- Reddit - Please wait for verificationreddit.com
- References and Borrowing - The Rust Programming Languagedoc.rust-lang.org
- Working with strings in Rustfasterthanli.me
- abseil / Performance Hintsabseil.io