Memory safety facilities in Rust

For a while now I have wanted to build my own compiler, because, as Steve Yegge said:

If you don’t know how compilers work, then you don’t know how computers work. If you’re not 100% sure whether you know how compilers work, then you don’t know how they work.
You have to know you know, you know.

The thing with building your own programming language is, you can do it in many ways. One way is to build just an interpreter and rely on the programming language you’re implementing it in to execute your code. Another is to produce low-level machine code. This second approach is the one I want to take. Either that or I’ll build my own bytecode virtual machine.

Since the purpose of building my own programming language is to learn something in the process of building it, I want to be able to go as close to the metal as I want. That means I have to build it in a systems programming language, such as C or C++. But, since I also want to work in a modern language with a powerful type system, I chose Rust.

To finally understand and internalize all the fundamental memory safety facilities Rust provides you with (to save you from shooting yourself in the feet), I gave a talk at a local functional programming meetup.

The slides were build using remark.js and are hosted here.

Originally published at