Wireless and Digital Services

PRESENTATION – Mozilla’s Rust, and why we love it

By Jonathan Pallant - Last updated: Thursday, October 27, 2016
Rust from Mozilla

Rust from Mozilla

As an Embedded Systems Engineer, I’ve written quite a lot of C code over the years. It’s the lingua franca of embedded development – available for every platform, widely understood and with a very (!) lightweight run-time. It is, in essence, a pretty thin abstraction of machine code and while it was undoubtedly very impressive in the early 1970s, I’m afraid I’ve come to the conclusion that it’s a pretty awful language. The problem is that it really doesn’t help you write clean, reusable, well architected, bug-free code. In fact, it makes it downright difficult. It’s not impossible – I like to think that much of the code I and my colleagues have produced is most of those things, but it can be exhausting work.

Which is why I was so excited when I came across Rust, from Mozilla.

Rust is a new programming language, with the tag line “safe, fast, concurrent – pick three”. It also has an assured future, with a powerful, committed user community, and Mozilla’s recent announcement that it will begin replacing much of Firefox’s C++ language with Rust.

Rust has a strict but expressive type system, it includes an excellent package manager, documentation generator and build system, and it compiles down to machine code using LLVM, so in theory it’s usable pretty much anywhere you can use C. It’s in development, and things such as targeting embedded platforms are a work in progress, but after playing with the language and watching the release train deliver solid updates every six weeks, I was sufficiently impressed to invite all of my software colleagues down to the canteen so I could tell them all about it. We got nearly 100 attendees, so it’s clear there’s widespread interest and nothing in there was confidential – so I thought I’d share it with the rest of the wide world. So, here’s my own view on Rust: