Rust — from the point of view of a Scala developer

I’ve decided recently to give it a shot and try to do some programming in Rust. I remember those days when I used to code in C/C++ (and even on devices with 48Kb RAM), so it was a bit indeed nostalgic for me as well. Nowadays, I’m using mostly Scala, Java, Haskell.

This would be my personal experience, so all opinions are my own and subjective.

Tools

I’ve started my journey with IntelliJ IDEA Rust plugin and that was the first my mistake. Surprisingly, afterwards, I found out that there are two different versions of Rust plugin from IntelliJ. The version for IntelliJ CLion works differently and has debugger support, for example.

I learnt cargo tool and its ‘toml’ file format really quickly (sbt or cabal/stack is much more complicated to compare with).

Overall, the tools for Rust mostly are good and mature enough. I have only one big issue with Rust plugin for CLion — it doesn’t work properly with the generated artefacts from procedure macros (the details here). It is really annoying, working without properly working autocomplete in this scenario.

Language

I have had no issues with Rust ownership/borrowing approach (it wasn’t a real issue for me after years using C++ and dumb/smart pointers), but I can understand some frustration about it from other developers.

Traits/impl are really close to instances and type classes in Haskell, so I feel appreciated that they also exist in Rust.

Annoying things:

Goodies:

Overall, I think Rust has a great and solid start. I will not migrate completely from Scala to Rust (especially when Scala 3 come, Scala is still much powerful language than many others), but it is definitely a great addition to the tools you can use to implement some cases (serverless, some microservices, low-level programming as a C replacement, WASM, …).

Software Developer & Architect