Hacker News new | ask | show | jobs
by alexandercrohde 2300 days ago
Can somebody please explain why Rust has so much buzz right now compared to scala?

Scala is a strongly typed, very-well vetted, functional programming language in the JVM. It pretty much has everything going for it. It's even adopted by twitter.

5 comments

JVM, garbage collected, doesn't have zero overhead abstractions.

Might as well ask why Scala didn't take over from C++.

> JVM, garbage collected, doesn't have zero overhead abstractions.

Is it fair to say that the significance of those points are these?

no JVM: easier deployment

not garbage collected: less latency

zero-overhead abstraction: smaller in memory

Yes, and more to the point said qualities make Rust suitable for use in kernel-type systems and embedded progamming, whereas any JVM or other GC and VM based language generally isn't.
I don't know why you'd be dismissive of that comparison. Scala is more like Rust than any other language he discusses.
I mean sure, Scala is a great language and has a lot more in common with Rust than most languages, but it's fundamentally designed for a different role than Rust. Rust is designed as a "systems language", whereas Scala's dependence on the JVM is a non-starter for such a role.

You could say instead that Rust is a Scala-inspired systems language. Not just Scala, obviously, but by functional programming concepts like algebraic data types and type inference. Rust isn't even really a functional language itself; it's still an imperative language.

Because performance is a P0 concern to a lot of people. Rust (and C++) has performance as a primary goal, Scala does not.
Did you even watch the video? The guy is comparing rust to things like Python which is a pretty silly comparison, relative to scala.
Everybody knows python, few people know Scala. Isn't that enough of a reason?
I don't use Rust. But I never considered Scala because of the JVM.
I am big on Rust, and I enjoyed using Scala at work in the past. Scala has a more elaborated type system, and everything is heap-allocated so some stuff is easier. On the other hand... JVM is often a PITA, and debugging blowing up memory issues was common. Compilation was slow (even slower than Rust), code was sometimes slow, and emphasis on OOP has made a lot of code I had to work with overly complicated and very much a typical OOP spaghetti garbage. Null pointers are still a problem (though much less than Java). Compiler is not as helpful as rustc one, though IntelliJ integration was more mature. Lack of macros encouraged code generation which was a PITA. Collections were messed up. Tooling wasn't half as nice.

The list of complains grew big, but again: all in all, I think Scala was quite fine to work with.

> It pretty much has everything going for it.

Hard to respond to that as it is so general.

> It's even adopted by twitter.

And larger companies than Twitter use Rust (though to be fair not as extensively as Twitter uses Scala).

They're really not comparable. Rust is a lower-level language with no garbage collection (yet with guarantees about memory safety due to ownership rules). Scala runs on the JVM and has significantly more in the way of OOP (depending on how you use it obviously).

That said, I've found that my extensive Scala experience does come in handy when learning Rust as some features of the type system, pattern matching, threading failures through with ?, etc. These are things you won't have any familiarity with from Java, but do from Scala.

I felt slight nausea and unexplainable deep irritation at reading this.

Scala is a disgusting mess compared to Rust in just about every way I can think of. Please for the love of everything good, consider at least Kotlin.

Twitter also uses Rust. Not nearly as much as Scala, of course, but there's the Pants build system (Python + Rust), stuff like https://github.com/twitter/rezolus