Go / Rust, what's new ?

by | 23 Feb 2021 | Web Expertise

Go (also known as Golang) and Rust are two languages that are often compared to each other. Relatively young, these languages are still evolving and gaining popularity among developers and companies. Explanations with Thomas Barusseau, Lead Developer at theTribe.

Go and Rust were respectively created by Google and Mozilla about ten years ago. Where are they today?

Indeed, Go and Rust are about the same age. Go has had obvious traction, being a project created by Google engineers with developer productivity as one of its goals. Rust started as a personal project that was eventually sponsored and then abandoned by Mozilla. They share many similarities (runtime safety, performance, modern paradigms) and both are used in production by many companies.

These languages are popular in surveys by developers who appreciate their simplicity and security. What about companies? Have they adopted them in their projects?

Simplicity is true for Go, and it is one of its strengths: the syntax is similar to C (which everyone knows), the execution of concurrent code is very simple(goroutines). The same cannot necessarily be said for Rust, which has a rather steep learning curve.

On the business side, we find Google (surprise!), Uber, Twitch, Dailymotion using Go. On the Rust side, we can find Microsoft, Dropbox, Discord, Yelp. Both languages have clearly made a breakthrough.

For what types of projects are these languages suitable and with which development ecosystem?

This is the strength of both languages: they can be used to develop any kind of program (although I doubt Go can be used seriously in an embedded context). Besides being "general purpose languages", they both have tools to eliminate runtime errors or at least move them at compile time. 

For memory management, Go is based on agarbage collector. Rust, on the other hand, differs from other languages by using a "lifetimes" model of resources. The compiler tracks the lifetimes of all the resources in a program, and knows exactly when in a program memory can be released automatically. So to answer simply: these languages also gain traction, because there is no disadvantage in using them (except perhaps a sometimes disappointing ecosystem compared to JavaScript or Python).

What do you think the trend for these two programming languages will be for the next 2-3 years?

Unfortunately, I don't use Go enough to answer this question! As far as Rust is concerned, I know that there are many new features being stabilized, many of which revolve around const generics. Since Rust offers tools that are completely different from what you can find in most other languages, the community is working on the best way to handle GUIs, or error handling. But it must be said that since the stabilization ofasync/await in November 2019, the developments of the language have calmed down: we have pretty much everything we need to do anything and everything, comfortably.

Will Google's announcement of a Go 2 for 2021 with more stability change the trend?

I know that type parameters (generics) are planned for February 2022. I don't use Go enough to understand how important this is: the language has been deliberately designated without generics, for performance and simplicity reasons. A program can never be too stable: if they manage to keep their promises, it can only be good for the ecosystem and the language.

What is the benefit for a company to use these languages?

It is in the interest of companies to use these languages: we have seen this with the timid adoption of Kotlin or Scala, which have managed to impose themselves against Java in companies that had literally been using it for decades.

Developers (and companies) want modern tools that allow them to be productive and express themselves freely. Developers want languages that give them strong guarantees even before the program is executed. Developers want languages that are complete, that allow them to easily manage dependencies, build, test. If you work in a field such as the web where these languages have an already vibrant ecosystem: go for it!

Florian Compain

Florian Compain

Chief Marketing Officer @theTribe

Why don't we talk?