I’m in the midst of learning Rust in more depth than before so using every excuse I can get to write some code using it. The creators made so many good decisions both in the language and the build/test/bench ecosystem that I finally get why it keeps on topping the most admired and desired list.
Why now, though? Well, having spent most (who am I kidding: all) of my professional career in financial technology, I always wondered why especially at the high-performance end Java and C++ still were so dominant despite the rise of what so many seemed to believe was calling what seemed a worthy successor. Even in game development, which is what kicked off this whole journey adoption seems slow.
Java doesn’t want to die and honestly just keeps getting better at a rapid pace but I always felt a lot less productive with C++ than Java just because of the difference in cognitive load working on some codebases requires; C++ has baggage. As for Rust I don’t find lifecycles and borrow checking to be wildly complex, which is a common complaint, different sure, but use it enough and it all starts clicking. I’d be willing to bet the same would be true for most C++ or Java developers. Engineers generally have a greater tolerance for taking a hit to productivity than users do, so taking some productivity knocks at compile-time vs losing business continuity at runtime to me is a win. Convincing your product owners of that benefit is an exercise I’ll leave to the reader.
With its potential to eradicate a huge class of common bugs it would seem like a no-brainer. Practically speaking, though, it likely just comes down to a few things:
- When at the sub-ms high-performance mechanically sympathetic code or even for interop with existing libraries you likely have to drop into some unsafe rust anyway.
- These other languages have a larger and historically proven, trusted, and optimized back catalog of frameworks to rely on (guava, commons, spring, stl, boost, specialist libraries with intrusive collection support, etc. etc.) whereas using crates still feels, at least to me at this stage of my journey, a process of imperfect discovery1.
Anyway, I’m just getting started but I’m having fun using Ferric Oxide: Fe2O3.
Just musing…
Footnotes
-
Case in point: I wanted to play with
mmap()
kernel calls, and I could just create some kernel-calling unsafe code of my own or I could grab thememmap
crate. Or maybe not:memmap
is unmaintained but still there and replaced with a less intuitively named because immutable cratesmemmap2
↩