flâneur — a map of the web's best reading

(Re)writing an interpreter in Rust - Danny van Kooten

dannyvankooten.com · 3,227 words · saved by 1 readers

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