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:

Brew c’est le petit gestionnaire de paquet pour Mac OS X, très utile lorsque vous voulez ajouter rapidement des librairies comme SDL2.

brew install sdl2


Cependant à l’école 42, une petite manip s’impose afin de pouvoir l’utiliser sans se soucier des droit d’accès administrateur. Voici un morceau de code pour installer brew sur vos sessions 42.
rm -rf ~/.brew
export HOMEBREW_CACHE=/tmp/mycache
export HOMEBREW_TEMP=/tmp/mytemp
mkdir /tmp/{mycache,mytemp}
/usr/local/bin/brew update
$HOME/.brew/bin/brew update
$HOME/.brew/bin/brew upgrade

Edit: Après avoir vu circuler ce script orphelin sans auteur, il semble que son origine nous vient de Kube via son github et quelque part dans les méandres de l’intra.

Lancer ensuite « brew doctor ». Il vous sera surement demandé d’ajouter brew au PATH (copier-coller la ligne) et hop c’est fait.

export PATH="/Users/qfremeau/.brew/bin:$PATH"

Ne pas oublier de mettre votre login à la place du mien « qfremeau ».

Brew Formulas

Un tour du coté de pour trouver votre bonheur et installer les outils dont vous aurez besoin. Il se peut que vous devriez parfois linker vos installations avec par exemple :

brew link valgrind

En général vos installations se feront dans le dossier /Users/qfremeau/.brew/Cellar. Il est mieux avec votre Makefile de linker avec le path complet. Vous pouvez obtenir automatiquement le nom d’utilisateur avec:

ID_UN := $(shell id -un)

INCDIR = /Users/$(ID_UN)/.brew/Cellar/sdl2_ttf/2.0.14/include/SDL2

Sommaire :


Un outil très puissant pour compiler et gérer ces projets : les Makefile.

Assez facile à prendre en main pour une utilisation toute somme basique, c’est lorsqu’on feuillette un peu la doc qu’on se rend compte de la puissance du Makefile. Je dois avouer avoir passé quelques jours rien que sur mon Makefile pour maitriser la bête (il me reste encore quelques zones d’ombre qui je suis sûr s’éclairciront avec le temps). Mais lorsqu’on possède un Makefile sympa, on peut copier-coller ce dernier pour l’adapter à tous ces projets 😉

Je remercie fdaudre-, agadiffe, jlagneau, mtassett, apachkof et ncoden de 42 qui m’ont permis d’y voir plus clair, en partageant ici et là leur propre Makefile et conseils. Voici donc le mien, que je vous explique ci-dessous… et pour éviter à ceux qui connaissent déjà le principe de se taper toute la lecture de l’article.

Lire la suite de