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
© Tomasz Waraksa, letsdebug.it
This article is not promoting any of the described products, services or vendors. We don't have any commercial interest nor associations with them. We're not trying to suggest that these products or services are best for you, nor promising that your experience will be the same.
In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this website and any information presented on it.
Through this website you are able to link to other websites which are not under our control. We have no control over the nature, content and availability of those sites. The inclusion of any links does not necessarily imply a recommendation or endorse the views expressed within them.
Permission is hereby granted, free of charge, to any person obtaining a copy of software published on this website and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions, unless stated explicitly otherwise:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.