I used Rust in production for 6 months! Here's my feedback
Are you in two minds when it comes to learning new programming languages? Probably you may feel the same when you first heard about the Rust programming language. Good things require some effort and here's what I have to say after using Rust programming language in production for a 6-month duration – It is great and Simply superb! Let's get the clear practical experience picture with Rust at Qovery.
Romaric PhilogèneJanuary 19, 2021 · 5 min read
Qovery is a Cloud deployment platform used by more than 1000 developers to deploy their apps on AWS. The part in app deployment is written in Rust (take a look, it's open-source). My team and I enjoy technical challenges, and when we decided to move out of Python (for robustness reasons), I suggested Rust!
Qovery is installed on the Cloud account of our customers! Meaning, we need to be 100% sure that when Qovery is installed, it will run forever with a minimum memory and CPU footprint. This is a critical piece of our product. It's a bit like launching a satellite into space. Once it's launched, it's nearly impossible to repair it physically.
This is where Rust shines. Once it's compiled, it works like a charm.
What we're doing with Rust could be done with Go. However, from my experience, I saw a lot of devs abusing Goroutines (lightweight threads), leading in concurrency issues. Rust prevents misuse of threads, which can be frustrating - but for good reasons.
There is a learning curve associated with each programming language. Like other languages, developers new to Rust will take time to learn the concepts, play with code, and be productive. You should not expect them to be effective in the first month itself. I'd recommend spending time to dig into crucial concepts like Borrowing, Ownership, and Lifetime to understand Rust better. I'd also recommend reading the official book on Rust programming language, which is available at - https://doc.rust-lang.org/book/.
Due to the excellent type system, Rust is safe by design, and it changes the way one builds applications positively. "Don't fight the borrow checker", spend time to understand why it throws you to error - it's for your good. You're probably doing something "wrong" for years without knowing. Personally, it was my case when developing concurrent features on other programming languages like Java and Go. So, don't fight the borrow checker, and embrace it :)
Rust has some great tools like 'Cargo' which is a Rust dependency manager. Cargo helps build code, download the libraries that the code depends on, and build those libraries. Suppose you are a Java or Kotlin developer and are familiar with IntelliJ IDEA, which is an integrated development environment in Java. In that case, you do not have to fear as there is an excellent Rust plugin available.
For me, the IntelliJ debugger works fine, but it may get challenging to get details on the variables when they are allocated on the heap. Here the LLDB debugger can help with ease. Which I honestly... don't use.
The Rust programming language has a lot of high-quality libraries. But the Rust ecosystem is not mature like Go, Python, or Java. In case you are unable to find something suitable, you will have to create it. This is an excellent and creative opportunity to contribute to the Rust ecosystem. The community developers are always looking for exciting things on Rust, and your contribution will help the community. That's why we open-sourced our deployment engine — trying to contribute to the Rust ecosystem in our way.
Even though error handling rust may be verbose, it is good to handle all cases. There are mechanisms like the '?' operator that aims to reduce the volume of error handling code, but at some point, like for me, you will have to handle it. But this is also why Rust is so safe, and you have to spend time handling errors instead of skipping them.
Depending on the size of your project, it will take time to download the libraries and build them and could take between one to ten minutes. At Qovery, we started with 2 minutes and 30 seconds of compilation time, and today, it is at 8 minutes. However, the Rust team has been making improvements to make the compilation faster through incremental builds.
Note: Pierre (CTO of Qovery) configured a distributed cache with SCCache, and we reduced build time per 2.
Rust programming language is excellent, but mainly the people who form the Rust developer community make Rust a great ecosystem. The community stands for equality and welcomes all. It is small and growing fast. The Rust tooling ecosystem is very active, enthusiastic, and growing, which has all the makings to spearhead Rust into a widely used language. I also try to contribute with Qovery and my free time to create new content to show that Rust is accessible to anyone - even with experience in only a high-level programming language.
Rust is becoming popular day by day, with greater adoption of Rust by organizations in the Cloud computing sphere. Rust language has many advantages and is the perfect language to build highly resilient applications. As developers gain productivity, you must think positively of the slightly longer learning curve and be patient in the first few weeks. These little investments will go a long way to improve ways to design apps. Rust has exciting career options, and we at Qovery believe in a bright future for Rust in the coming years.
If you are excited about Rust (as we are) - drop us a line :) Stay safe.