Starting to Rust as a Go developer

50 points WorldlyTrade1882

Hey everyone!

I have been a software engineer for almost 7 years, 4 of which mostly in Go and Python.

I have bits of experience with JS and Clojure (just for fun), but that's negligible.

I must confess, I really like Go and its approach to simplicity and getting things done. This is the programming language that pays my bills and lets me focus on the domain without thinking too much about the programming language itself. Its standard library is also superb and for the traditional web backend kind of work, I rarely need anything else apart from a router and some tiny libraries to work with different databases.

With all that said, I have always felt some sort of engineering attracting towards Rust. Go is often criticized for the amount of boilerplate, the absence of enums and pattern matching, error handling, and a fairly weak type system (Go creators say it was made weak deliberately). Au contraire, Rust is very typically an example of what a modern programming language with a focus on reliability should be.

I have finally decided to see for myself what Rust has to offer and what is so drastically different from Go.

A quick disclaimer: I have read a few blog posts comparing Go and Rust so I more or less understand that these languages are not really direct competitors regardless of the endless Go vs Rust posts.

In my case, however, I don't even have any illusions or plans regarding changing my main programming language. As far as I understand, it's not even about the language per se, but rather about the general scarcity of Rust jobs where a lot of them are in blockchain (I don't think I'd be interested unless it's a ton of money). Or positions where the limiting factor will be one's overall low-level understanding of systems.

My main goal is just learning a modern and complex programming language that can (that is often promised) make me a better engineer overall with a much deeper understanding of computers. If I happen to fall in love with the language, who knows, maybe I will even work with it professionally.

This week I started reading the Rust book (covered 9 chapters), and today solved 45 Rustlings. What I can say is that there are some pleasant similarities like Go interfaces and Rust traits, preference for composition over inheritance, explicit error handling (very differently though), etc.

The differences are also many, but so far I don't feel overwhelmed or frustrated. The book + Rust By Example (also Claude) reduce the average frustration time to seconds.

I am wondering what could be a viable next step for me to continue my journey with Rust. I like the Rust book, but it's obviously a (great) introduction to the language.

I have discovered there is Zero to Production in Rust which seems pretty similar conceptually to Let's Go and Let's Go Further (books on Go backend development) where the author builds a real app and shows language best practices.

My current plan is to finish TRPL first and then read Zero to Production in Rust cover to cover and tweak it so that I can both learn more about the language and also build something similar to what I do on a regular basis in Go.

Based on some research and similar posts, I have come to the conclusion that maybe I should swap Actix for Axum. Of course, I don't have any personal opinion on the differences between them, but it seems that Axum's popularity is increasing. Also, implementing the project from the book using a different library might be a useful experience by itself.

What do you think about this plan? Also, hearing from fellow Gophers that converted to Rust or just picked it up would be super interesting.

Cheers!