RUST – Not just for programmers

As an optical systems engineer, modeling complex systems is a routine part of the job. Since we often rely on time-consuming simulations, the efficiency of the programming language we use becomes a serious consideration. That’s why we typically gravitate toward C or C++, along with legacy libraries built on Fortran.

Rust isn’t usually the first language that comes to mind when tackling a new problem. It’s often seen as a language for professional programmers, known for its steep learning curve. And yes, I think that reputation is mostly deserved. But I also believe Rust has something to offer, something that’s worth a closer look.

Growing Complexity and Hidden Costs


When we plan a project, we rarely know exactly where it will go, especially if it turns out to be genuinely useful, which is the whole point, right? As the software matures, we often find ourselves wanting to integrate it into different contexts, each adding new layers of complexity, often far beyond what we initially expected.

With C or C++, we’re responsible for managing all the little details ourselves. Is this data still valid when I try to use it? Did we release the mutex on this code path? The list of such questions gets long, fast.

Flipping the Script

Rust flips that dynamic. It offloads many of those concerns to the compiler. In a sense, the compiler becomes your second set of eyes, saying, “You can’t do that—here’s why.” A piece of software that compiles in one context might refuse to compile when adapted for another—and that’s often a good thing.

With C or C++, the code might compile just fine, and if you’re lucky, it’ll crash immediately when something’s wrong. But sometimes bugs stay dormant for years, only surfacing when you make a change. Worse still, they may not crash anything, they just subtly skew results once every few hundred runs.

Sure, with good testing practices and tools like sanitizers, you might catch those issues. But let’s be honest: when your primary expertise is physics or optics—not software testing—having a compiler that proactively prevents entire classes of bugs becomes genuinely attractive.

Why Rust Is Worth Considering


Rust doesn’t guarantee correctness, but it does watch your back. It helps you avoid not only the obvious mistakes, but sometimes the hidden ones too, before they turn into real problems. And it does all that without sacrificing performance. For those of us working in domains where precision and correctness are just as important as speed, Rust offers a rare combination: the safety of a modern language with the performance of C. That’s a trade-off well worth considering.

The Overlooked AI Support

Does it even make sense to learn to code? Today, absolutely. Even better, you have a 24/7 tutor with ChatGPT or Grok. If you ask me, both suck at coding. Really, not kidding. They simply suck, but they are great at answering specific questions. Question about strategy, or about tools (crates in Rust-language). If you start with Rust, don’t ask it to give you code, read the book and ask for explanations.

Leave a Reply