Published on 27th of April 2017
The Future of Rust
Let me first point out the obvious: yes, the title is a little sensationalist. Also
you might be asking why I should be entitled to talk about the future of Rust. After
all, I'm neither part of the Rust core team, nor a major contributor to the Rust
ecosystem. To that I answer: why not? It's fun to think about the future of
systems programming in general and Rust in particular.
You might have heard of the near-term goals that the core team has committed itself to. Faster compile times and a more gentle learning curve come to mind.
This post is not about that.
Instead, I want to explore some more exotic areas where Rust could shine in
five to ten years from now. To make it big, we need both, roots and wings.
Right now, the most popular languages for Data Science are Python, Java, R, and C++.
We've observed that while prototypes are mostly written in dynamically typed
languages like Python and R, once an algorithm reaches production level quality
it is often rewritten in faster languages such as C++ for scalability.
It is not unthinkable that Rust is going to be some healthy competition for C++ in the near future.
The benchmarks of leaf, a machine learning library written in Rust, are already nothing short of
Games are another area where Rust might shine.
It's financially attractive for Game Studios to support multiple platforms without much
rustup make cross compiling easy.
Modern libraries slowly fill the tooling gaps for large-scale game development.
Rust's support for the Vulkan 3D graphics API might already be the best of class.
The killer feature though is the unique combination of safety and performance.
If you ship a game to a million players and they throw money at you, you'll better make sure that it doesn't crash... right?
That said, the first AAA Rust game might still be far in the future. Here's Blizzard's standpoint on Rust in 2017.
Maybe — eventually — we will also see formal verification of the Rust core. Projects like RustBelt would then open new opportunities in safety-focused industries like the Space industry. Wouldn't it be nice to safely land a Spacecraft on Mars that is controlled by Rust? (Or by one of its spiritual successors.)
I wonder if SpaceX is experimenting with Rust already...
Integrating with other languages
There are many other areas I haven't even mentioned yet. For example, financial and medical software or Scientific Computing, just to name a few.
In all cases, Rust might be a good fit. Right now the biggest barrier to entry
is probably the huge amount of legacy code. Many industries maintain large codebases in Cobol,
C or Fortran that are not easily rewritten.
Fortunately Rust has been proven to work very nicely with other languages.
Partly because of strong C-compatibility and partly because there is no Runtime or Garbage Collector.
A common pattern is to optimize some core part of an application in Rust that has hard safety/performance
requirements, while leaving the rest untouched.
I think this symbiosis will only become stronger in the long run.
There are even ambitious projects like Corrode which attempt to automatically translate C code to Rust.
Overall I see huge potential for Rust in areas where safety, performance or total control over the machine are essential. With languages like Rust and Crystal, a whole class of errors is a thing of the past. No null pointers, no segmentation faults, no memory leaks, no data races.
I find it encouraging that future generations of programmers will take all that for granted.