I’ve read this article yesterday, written by an engineer at Discord. It describes their ongoing migration from Go to Rust:
Performance and memory efficiency of their massive multi-user communication platform is a challenge. They’ve first implemented it with Go, now they’re using Rust to make it even better. The article is an excellent insight into daily struggles of software engineers. And into the forensic science of programming.
What strikes me, is Rust’s bold approach to memory management::
Rust is blazingly fast and memory-efficient: with no runtime or garbage collector, it can power performance-critical services, run on embedded devices, and easily integrate with other languages. […] Rust uses a relatively unique memory management approach that incorporates the idea of memory “ownership”. Basically, Rust keeps track of who can read and write to memory. It knows when the program is using memory and immediately frees the memory once it is no longer needed. It enforces memory rules at compile time, making it virtually impossible to have runtime memory bugs. You do not need to manually keep track of memory. The compiler takes care of it.
Isn’t that fascinating?
Over the years we became conditioned to accept garbage collection as necessary cost of making applications safe and stable. As opposed to manual memory management and forgetting that
free() again and again. Turns out, there are more choices than between the red or blue pill :-)
In coming months I’m planning to embark on my adventure with Go. I have a few ideas for small terminal utilities - those little things you wish someone wrote them, but nobody ever bothered. With Go we can easily write cross-platform applications, so Let’s Give it a Go!
Long live the rainbows and unicorns!
Author Tomasz Waraksa