Hacker News new | ask | show | jobs
by namelosw 1222 days ago
Scala is a great language. Any time I'm programming in other statically typed languages it's like programming but with my hands tied backward: bumping into things and realizing there's no HKT, Type Class, GADT etc.

However, it's sad to see it's growth is likely to be capped - because JVM languages is not that fashionable like 2003 or 2007. What's in nowadays is Go and Rust: bear metal, small binary, fast startup speed, solid module packaging system (without all historical stuff or touching Maven), etc.

Even though Scala Native is there, the language was tailored for JVM and it will never get rid of that.

Maybe a ground-up Scala-like language like Go or Rust could fill in the market and gain popularity? A language with GC/runtime like Go but not as awkward on abstrations. But it's unlikely to happen - the compiler would be much harder and complex to implement compared to Go.

3 comments

> Any time I'm programming in other statically typed languages it's like programming but with my hands tied backward

I feel the same when I have to code in Scala instead of Haskell, because the former has to be used for third-party JARs from enterprise vendors that pretend that there only are JVM and .NET.

After the newstyle Cabal, Sbt feels like a bunch of dynamic nonsense too, especially if there's classpath-based runtime-delayed dependency resolution.

I also find that documentation feels more lacking, simply because I cannot easily find third-party libraries and standard definitions by their signatures in my browser address bar, like I can in Haskell with Hoogle: "!h f a -> f b".

Maybe Rust is close enough to this ideal imaginary Scala-like language. I'm not a Rust expert, but I really like how Rust combines power with a certain minimalism (not in the Go sense, though). There are, for example, no classes with inheritance in Rust, but traits, whereas Scala has traits an all the Java OOP heritage. Another thing is error handling that is handled with return types in Rust, where Scala has also exceptions from the JVM. Same is true for null, what probably shouldn't exist in any modern functional language. Rust doesn't have it while Scala needs it.
Rust has no GC and, unlike Scala, doesn't embrace full immutability. This is of course fine, because it focuses on performance, but it means a very different development experience.

Also, Rusts typesystem is lacking many of Scala's features and I don't think it's realistic to add them retrospectively.

How do you get over the lack of type inference in Scala?
Yeah it works whenever you yourself can infer the type without it already.
Scala's type inference is not very good, especially in comparison with Haskell