Learning Rust

I have always had an interest in programming languages and concepts, mostly related to systems programming. That’s pretty much why I studied computer science. Even if I have never been employed as a programmer, I have created and contributed to several bigger projects during my time as a researcher (e.g., WayWise is a more recent open one). My goto language is C++ (11 or later), often paired with the Qt framework. Having worked with safety-critical systems during the last years, I have often thought that it is far too easy to introduce hard-to-debug bugs in C++ if you do not enforce certain rules (say MISRA C++) and wondered about alternatives.

The Rust programming language is certainly one of those alternatives I read about for a long time but never really got around trying out for more than primitive examples. Having a bit more spare time, I figured now is the time! Considering that Rust 1.0 was released almost exactly ten years ago and being voted “most admired” language for the ninth time in a row in the last Stack Overflow developer survey, I feel a bit late to the game but considering that MISRA just recently published MISRA C:2025 Addendum 6 Applicability of MISRA C:2025 to the Rust Programming Language there is apparently still a momentum and this is a good time to more closely investigate Rust for the use in safety-critical systems and cybersecurity contexts. Whatever, I feel like learning it in any case. 😊

To me, Rust feels like someone programmed for decades in languages like C/C++, gathering frustrations along the way, but deciding that newer languages (than C/C++) like Python, Go, C# are the wrong way to go. “Technology from the past come to save the future from itself.” is a quote that is very fittingly ascribed to Graydon Hoare, Rust’s original creator. As a C++ programmer, Rust is intriguing because problems that are common and hard to debug in C/C++ (dangling pointers, use-after-free, double-free, buffer overflows, out-of-bounds accesses, …) are not possible if you stick to safe Rust, and often already checked at compile time (more details in later posts). Of course, a lot has happened in the last years as well to avoid these common problems in C/C++ as well including modern standards introducing, e.g., smart pointers, static analysis tools and runtime sanitizers but compared to Rust they are afterthoughts. I like the gör det lätt att göra rätt approach of Rust as one would say in Swedish (“Make it easy to do the right thing.”, where ’easy’ is admittedly debatable in this case but we will discuss this in later posts.).

This post is the start of a planned series. My next goal is to write a simple static site generator, just like Hugo I am using for this blog but at toy scale. This is not really safety-critical but will allow me to look into dependency management and testing with Rust without a lot of interesting distractions… Let’s see how that goes! 🙃

Posts in this series