Last Tuesday, 4 April, I was able to do a conference at OVH office in Lille about Rust in Production and Mozilla’s Servo project. This meetup organized by OVH was one of the starting point to understand Rust and discover its usage in companies. Like OVH that is recoding some of its services in Rust to boost its usage, Mozilla is now integrated Rust into its own services to existing apps such as Firefox.

But wait, Mozilla is indeed the creator of Rust programing language and has been developping Servo for now more than 5 years. The aim was to boost the Internet usage. Nowadays our internet connection is getting faster and faster (plus we are more and more connected everywhere), but our web browser tends to get old. Actually, the web rendering engines still exploits so less from our computer. Rust was the response to a real need: more parallelism with more security and more efficiency.

So here are the resources with the video conference – only available in French:

Slides & Talk

Thanks to Antonin Carette, Dernier Cri and Lille FP, a meetup about Rust was organised last Thursday evening. We also talked about a bit about Elm but this article will only deal about Rust.

Since 2010 (unofficially way earlier) Mozilla is working on Rust, a new programming language to improve coding performance and nowadays Rust is getting more and more interested since its first stable release in 2015. This meetup was the opportunity to introduce people to Rust and succeed to get ~75 attendees. Feedback was largely positive and a ratio of 3 out of 4 people is willing to code on Rust after the event.

More meetups will be organized going further on different concepts but if you missed that one, here is another short introduction.

You can also get the slide and the video on their GitHub.

So what’s so cool about Rust ?

You need to understand nowadays problematics are different from ~20 years ago. And for sake, computer architecture evolved from a one-core CPU to a multi-core CPU. We are implicitely using a lot of parallelization and multithreading programs on our computer. However as a developper when you come from C++ or some related languages you understand how much it can be difficult to build your app safely with multithreading – adding you more time to debug it.

That’s why Rust was the idea to create a modern language to respond to this kind of issues. A lower programming language with more memory safety and that educate you on how to code with good practices. In fact Rust is using a compile time error system, that warns you a lot about wrong coding you won’t really notice in C++. While compiling for the first time a simple code can be frustrating, the error handling prevents many further « aborting » issues you won’t really understand at running time.

Whereas Rust programming philosphy can be different, it avoids you to write code riddled with security vulnerabilities, memory leaks, and race conditions. To put in a nutshell, Rust has:

  • simple and safe concurrency mechanisms,
  • a useful and intellectually interesting task abstraction,
  • provides strong memory safety guarantees,
  • but still allows programmers explicit control over memory management

Moreover Rust would be nothing without Cargo, its package manager that provides you official tooling to help awesome developers like you (because we know you are) to debugg easily your app and build it with Crates. Actually Crates are dependencies provided by Cargo. With a specific file .TOML you can set your dependencies and track their behaviour independently within your app. As much as you can set a bunch of unit tests to check if your main features works as they should.

$ cargo test
   Compiling adder v0.1.0 (file:///home/you/projects/adder)
     Running target/debug/deps/adder-91b3e234d4ed382a

running 1 test
test tests::it_works ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured

     Running target/debug/integration_test-68064b69521c828a

running 1 test
test it_works ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured

   Doc-tests adder

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured

Yes, even if Rust is still young, it’s pretty powerfull and it has a nice open community. Just check out here!


What’s up, on the Rust planet?

Rust is mainly developped and maintained by Mozilla that allocates ressources to this project. But it’s Open Source and it has support from other actors such as:

Mozillia is working on Quantum project to boost Firefox rendering engine. Servo which is the engine being developed in Rust has shown some really interesting features and performance, you can watch this video to learn more about Mozilla and Rust projects:

Want to learn more?

If you still wanna learn more about Rust, I freely quote this article Introducing Rust to coding classes.

And of course check out these meetups if you are from France: