Rust: thoughts after 1 month

2 minute read

this is a placeholder image

Background

I have always wanted to learn a low level and learn it well to get into the world of performance demanding applications like computer graphics, algorithm implementation, etc. The obvious choice was always C++ due to its rich history and legacy libraries. I started and restarted learning C++ couple of times due to different reasons, but never got to the level where I can call myself a C++ developer. Writing a medium size project or anything beyond a few hundred lines of code in C++ has often been followed by constant anxiety since it is perfectly valid to write and compile a code that will leak memory or produce a segmentation fault. Writing correct C++ felt like an unreachable goal achievable by years of practice.

Of course when I first heard all the hype about the C++ competitior Rust with a slogan “fast, reliable, productive: pick three.” I got interested. Taking more time to read about its features like modern compiler that that ensures memory and thread safety I made a decision to try it. Here a few videos that reinforced my will to give Rust a chance:

What i did last month to get started

What i like about Rust?

From the top of my head, those are the few points that blew me away:

  • cargo is what C++ was missing for me all along. pip or dotnet users will feel at home since it is both a package manager, and a build tool. Starting a fresh project with cargo is literally effortless, compared to building a C++ project.
  • Strict compiler. This is a questionable feature for some people, however, writing C++ as an inexperienced developer can sometimes feel like walking over a minefield of segmentation faults. Rust is a very safe language, and the compiler is your best friend and teacher. Rust compiler is built in way that won’t let you create memory unsafe / thread unsafe code unless you explicitly ask it to let you do this with the unsafe block (similar to C#). I think this is a good feature for those of us that just start working with system level language.
  • Very good error messages. Let’s be honest, oftentimes C++ error messages are big but make little sense. Rust errors are very descriptive and guide you to find the fix much more effectively.
  • Community. The community is what Rust creators themself put first. Low level systems programming has a somewhat legendary reputation of being accessible to a small number of smart people that spent an excessive amount of time practicing it. The first thing you see vising Rust website is: A language empowering everyone to build reliable and efficient software. Building a large friendly community for systems programming is Rust’s priority number one, and from my experience based on the documentation, question forums and other media it is true.
  • snake_case is the de facto standard formatting.

What i dont like about Rust?

Short answer is, nothing, but I will try my best to update this section for the next blog about my Rust experience.

What’s coming next?

A blogpost about half a year’s progress where I will implement some CLI’s or rewrite some of my older code in Rust.

Tags:

Updated: