< Back to articles

How we learned Rust

Did you know that Rust is according to the Stack Overflow 2023 survey the most admired language? We all heard about its speed and safety, but is it also a good choice for the digital agenda in 2023? We tried to figure that out in our almost 7-month-long crowd learning course called School of Crab. Let’s take a look at our journey and what we learned.

How it started

Learning new technologies and languages is not just fun but also a necessity to remain competitive and meet evolving customer expectations. Last year we started a cooperation with our Ackee Blockchain Security on a project for Glitter Finance (read our case study), therefore the need to understand technologies running on blockchain was important. The logical choice was Rust as the main programming language for Solana programs and also a possible alternative for our backend services.

The format and goals

Why did we choose crowd-learning? We did that before for Go, Flutter and advanced TypeScript features previously and we love the concept. This time we wanted to do something more than just meet once per week, so we included a leaderboard to motivate ourselves. How to win? You could get points for:

  1. Completing coding tasks on Codewars.com
  2. Leading the meeting (preparing agenda, checking time schedule)
  3. Preparing topic in the agenda and presenting it at the meeting
  4. Present the progress of your personal project

Our main goal was to learn Rust well enough as a potential future replacement for our primary Node.js or as a secondary language and how to learn the language better than writing a proper app or a library, that’s why making at least a small project written in Rust was a requirement to finish the course.

Rust: Let’s start coding

The start was slow but we absolutely enjoyed the quality and amount of official materials to learn the language from the beginning to the end. Probably the most important part was the inclusion of live coding puzzles called Rustlings. They provide nice practical examples of theory including references to official documentation or Rust by Example. We enjoyed the first 2 months with Rust semantics and easy-to-understand constructs that were making sense together with built-in lint and test capabilities. If things went bad during the meeting during live coding, the powerful Rust compiler was the savior. The error handling and power of the type system were amazing. We solved 5 coding katas and went over half of the rustlings, life was great.

Things were getting spicier

Time passed quickly and we got to the harder concepts. When we went through the ownership and lifetimes concepts the enthusiasm left some of us. And we didn’t know that this would become our nightmare for the rest of our time with the language. The Rustlings puzzles were still pretty easy so we challenged ourselves with advanced katas and there came also the first problems.

We started struggling to write simple things we can do in other languages (functional/object-oriented) in Rust and we often needed to choose some unobvious approach. The lack of struct inheritance and interfaces was falling on us and the fights with the compiler became our daily bread. We also started working on our personal projects and found out that understanding complex Rust code is also a hard discipline. The typing system is very powerful, but sometimes it makes reading the code harder. One type can change the context of the whole code and when macros are included, it is even more complicated to understand what is happening behind the scenes.

We understood that these are design decisions behind the language that make it unique and also good once you learn the language very well, but the learning curve became just too steep for some of us.

Finishing the school of Rust

Some of us decided that Rust was a challenge they didn’t want to complete, and others just didn’t have time to work on the personal project, but our brave attendees from the backend team finished it and accomplished the goal. The reward for them was a memento in the form of a t-shirt with lovely Rustacean. Lovely people, lovely crabs ackee picture As the discussion went on we decided to not switch to Rust or consider it as our second language mainly because of the steep learning curve for newcomers and the complexity it would bring for us now. But never say never, right?

And what about the final projects? Two of them are also available for you as an open source, give it a try:

Pavel Švagr
Pavel Švagr
Backend DeveloperEven though Pavel is a backend guy, he is also interested in frontend and design. He is the first to arrive to the office and the last to leave – mostly for sports, photography, film or music.

Are you interested in working together? Let’s discuss it in person!

Get in touch >