Hacker News new | ask | show | jobs
by akerro 3812 days ago
Is Rust the future? As a C++ (hobby), Java (full time) developer, should I invest my time in Rust?
7 comments

If you're just concerned about employment then you'll probably be fine with java (maybe go in the future). If you're looking for self-improvement then its always a good idea to learn a new language, especially if it does something different like Rust's borrow checker. Outside of that, I also used to do all my hobby code in C++ and after learning Rust I'm never going back to C++.
>maybe go in the future

Go is not going to replace Java in the future. For a language which cannot even lock dependencies to a version, people sure like to pretend it is the holy grail because Google made it.

Out of all the new languages of the last 5 years or so (D, Rust, Crystal, Go?, etc.) I think Rust shows the most promise. It is attracting both c/c++ people and people coming from dynamic languages (Python, ruby, js). So I'd recommend trying Rust out for sure, not much to lose, maybe spending a day...
The first release of D was in 2001. That's 15, not 5, years ago.
Though, what I find odd is that for me (and yes that is an extremely small sample) I barely heard of D until people started wondering why rust was being picked over D.
D has always been well known in the C++ community given its authors.
As a fan of Rust I don't think it is really going to be the future. While it might be successful in its own way I now believe that it will remain relatively small-scale (compared to e.g. C++ and Java). The entrenched players are extremely entrenched and Rust lacks the mass appeal that popular languages such as Ruby and Go have, being more complex to learn and write.
I started playing around with Rust a few weeks ago and fell in love; it has some quirks for sure (the whole borrowing system is a bit tough to grok at first) but it didn't take long for me to start seeing things the "Rust way." My only hang-up with it right now is that so many of the most useful packages in Cargo depend on the nightly build of Rust.
Could you list which packages you tried to use which were blocked on a nightly? In many cases a package can be moved off nightly with trivial changes, I can try to do it.
I tried digging around but couldn't find the package names -- I could've sworn ansi-term (https://crates.io/crates/ansi_term/) and hyper (https://crates.io/crates/hyper/) were two of them, but it looks like they both use stable. Thanks though!
Depends on when you last tried I guess.

So what happened was that many of these packages existed pre-1.0 when there was no stability system. Nobody knew which features would be stabilized (if you go further back, the fact that things would be stabilized in such a way wasn't clear either).

So we all just used whatever feature we liked. Many of these unstable APIs or features had stable counterparts, but the choice to use an API/feature was made pre-stability, so nobody had any way of knowing. Which meant that a lot of unnecessary unstable API usage persisted after 1.0. Some crates made a transition. some were slower (I think hyper was pretty quick to stabilize). Servo, for example, didn't have any issue with using nightlies for various reasons so we kept using unstable APIs (I later audited and removed low-hanging extraneous unstable API usage. Most of our out-of-tree crates are stable too).

There have been efforts both by maintainers and by individual community members to bring crates to stable, and I think at the moment most useful non-plugin crates work fine on stable. Let me know (@Manishearth on twitter) if you find a crate that you need that doesn't work on stable!

Ah, that makes perfect sense. Thanks for the breakdown, and I'll definitely let you know if I run into any issues with packages on nightly!
I think you should lean Rust just for some new insights and patterns (error handling, optionals, pattern matching come to mind). It might make you a better programmer over all.
If you invest your time in reading books then with same success (at least) you can invest your time in Rust. And there are chances it will be even more useful.
Rust, Go, Java, Scala, Clojure, Javascript... (leaving out quite a few other choices for brevity). They say choice is a good thing but too much choice is actually really annoying and fragments the community across a very large number of ecosystems.
I see the point you're trying to make, yet:

- Nobody in their right mind would choose Rust or Javascript for a project where the other is more appropriate.

Though (AFAIK) Scala and Clojure both interop quite well with Java, and Scala/Clojure interop isn't terrible either, plus there's definitely a culture of reusing in Clojure/Scala all the stuff that the Java ecosystem already had. So this cluster isn't causing much fragmentation at all.

You have something of an argument that Go and the JVM languages clash for mindshare, but at that point the argument around really annoying fragmentation has kind of lost steam.

I can't stand JS and Go syntax, I tried a few times... This is the worst thing that happened to humanity after in XXI century. I feel more comfortable with Prolog than with JS.
In a way Go is a step backwards from C towards Pascal. Since a number of people that had extensive C experience and were in fact present at the birth of the C language made that decision I figure they are doing it for a good reason.

I can read Go easily enough, I haven't done any major writing in it (yet), other than some minor work on Hugo trying to help to nail down/replicate a bug. It was easy enough that I think I'd pick it up quite fast, the syntax feels 'weird' to me but that's most likely just unfamiliarity.