the rush in Rust

first, the blog post on great rewriting in rust

The author is guessing who is the winner for the 20s, and it's neither C, Java nor Go.

Each decade comes with a modern language that resolve a problem at the time. The blog author is guessing who is the winner for the 20s, and it’s neither C nor Java - despite these twos are trying to come back. It’s not Go either, since he claimed Go can only work in cloud-native tools and cross platform interfaces.

He shifts his focus to Rust, a candidate who manages to satisfy both high and low level programming, and contains the sign of modernity, such as open source and generics.

Rust was considered as a new born language since 2010, and its adoption was more like a hooby choice instead of a real language. #riir used to be a meme since every single small group gradually migrate into Rust, and they keep using #riir - rewrite it in rust as a meme whenever a migration happens.

Some keyplayers started to touch Rust since last year. Like Discord, or Morzilla. But not until the move of Google - the backbone behind Golang - that Rust begins to be taken seriously. There has been a long term debate between the domination of Go and Rust, and the fact that Google chose to migrate some of their services into Rust somehow turned the table. #riirisnolongerameme

I summarized some related news on Go and Rust lately, one of them is why Rust and Go are better together. The pros and cons of these two languages and how they support each other. The two are recommended as the creators made it to resolve the current issue in software development: concurrency, scalability, open-source aware, safety and team productivity.

Discord claimed its move from Go to Rust happened not so long ago. Discord receives a big volume of ReadState per user per channel to monitor and track if the user has or hasn’t read the message. This requires a quick read state, and its service continuously needs to update, adjust and reset. Optimizing its performance is considered as the top priority. Golang, unfortunately, failed at this due to its garbage collector and memory management model. Go’s garbage collector runs so often to find any memory that has no references. Given this, instead of freeing immediately after the memory is out of use, it simply takes more time to assess what memory is truly out of use and slow the whole thing down. Through assessment, it takes Go like 2 minutes at minimum to finish its determination per memory. A freaking large spikes.

Rust, on the other hand, does not have garbage collection. Rust keeps track of who can read and write to memory. It knows when the program uses memory and immediately frees the memory once it is no longer needed. This traces back to the issue: Which programming language is better than others? The answer is what kind of problem that needs to be solved. Discord is a service that requires strong performance; Rust> Go is apparently. It’s about controlling and managing the memory to reduce redundancy.

Firefox also made the same move earlier this year. First started life as a side project in Mozilla Research, Rust now has been utilzed on Stylo, the CSS engine in Firefox which replaces approximately 160,000 lines of C++ with 85,000 lines of Rust).