3 ms·
I’ve been writing rust full time for the last 2 years, and I’m going to make a bold prediction: I don’t think rust will displace Java at all. Rust is a gorgeou
by josephg 4y ago
I’ve been writing rust full time for the last 2 years, and I’m going to make a bold prediction: I don’t think rust will displace Java at all.
Rust is a gorgeous language and I love it, but it optimizes for making good binaries over being easy to learn and use. Java shops don’t use Java because it’s clever, clean or fast. They use Java because it’s a known quantity, it works, it’ll outlive everyone and it’s easy to hire for. Java is popular precisely because it’s not new or shiny. Because there isn’t a new framework every week that you need to learn to stay on top of things. Java is a language for late adopters, who said no to Scala, Clojure and Kotlin. Why would they switch to rust?
If rust displaces anything it’ll be systems languages - C and C++ in web browsers, databases, Linux, embedded systems and some video games. And safety critical systems like helicopter control systems. It remains to be seen if it makes any serious inroads in web services. I can still throw web services together in nodejs dozens of times faster than I can in rust.
Rust isn’t trying to be the world’s most productive language. Rust would rather complex syntax and fast binaries than simple syntax and slow binaries. So it’ll always be harder to learn than Go, Java, C# or Swift. I honestly think Swift - if it had rust’s tooling and ecosystem - is a better language for general purpose computing.
Rust is a lovely language, but like every other language, it’s no magic bullet. Add it to your toolbox, but don’t throw out your other tools.
- zozbot234 4y agoBack in the mid-1990s, Java was the first type- and memory-safe language to be widely adopted in the enterprise. It was, in a sense, the Rust equivalent of its day when compared to the previous standard of C++. It may have been a lot slower and clunkier than C++ back then or Rust today but this mattered less in the 1990s when if anything, its unique cross-platform development story would've made it feasible to seamlessly deploy it on high-performance servers and midrange machines. Sure, today Java/C# are mostly adopted as a matter of convenience but this wasn't always the case.
- lucidguppy 4y agoVery good points - I agree. Kotlin and other Java++ languages would be their goto rather than rust.
- HideousKojima 4y agoI'll give another reason: the typical Java (and JS/Python/whatever) developer doesn't have the knowledge, dedication, and interest to learn it. And companies don't care about maximizing performance in most cases, they want good enough for cheap enough, and a decent Rust dev is going to cost more than a decent Java or .NET dev
- zozbot234 4y agoDedication and interest among developers will grow when compelling stuff starts to be written in Rust. Same as Java in the 1990s, .net, Python and Ruby in the 2000s or JS in the 2010s.
- HideousKojima 4y agoNo, I'm saying the typical dev doesn't have any interest in learning anything new beyond what they already know, and some hot new thing in Rust isn't going to change that. The level of mental effort needed to learn Rust is greater than the typical dev is willing to expend on anything.
- allochthon 4y agoI'm an experienced Ruby web developer, and I'm starting to learn Rust. You mentioned Java and Nodejs, but I still wanted to chime in on the topic of languages in web development more generally, and the applicability of Rust to web development. After tackling the refactoring of a complex Rails app that has a rules processing engine implemented on top of ActiveRecord, the true cost of Ruby's lack of static typing has become apparent to me. It's clear now that you can get a web app up and running quickly in a framework like Rails (as one example of a convenient, low-friction framework). But once you need to turn it inside out and make significant changes to the implementation, you're walking on egg shells and relying on previous devs to have built out good test coverage. A web app written in Rust would be easier to refactor in important ways at this point in the life of the app. It is clear there was a cost to using Ruby, but also that it was deferred.
- marcosdumay 4y agoWe need better ABI standards (or any at all). I do agree that Rust is prone into displacing C (and very simple C++, any C++ that needs the ++ part was already displaced by now), but I do think it will make inroads into plenty of places it shouldn't be. That's because the foundational tools will get written in it, and this leads people into consuming those tools in Rust code too, to avoid incompatibilities.
- 62951413 4y agoI thought Rust was to C++ what Scala was to Java. Which implies two communities which don't overlap much. I loved C++ 20 years ago but I'm not going back to manual memory management. I'd rather hold my nose and use golang if the JVM languages don't keep me employed anymore.
- zozbot234 4y agoRust is more like Kotlin compared to Scala. Except that C++ also has plenty of footguns, in addition to the accumulated complexity.
- stcroixx 4y agoTotally agree. Java shops don't have the memory safety issue Rust solves. Without that benefit, why bother switching? C++ and Java don't overlap much in the domains they're used in in my experience. Rust may totally replace C++, where the memory safety issue exists and high performance is critical.