9 ms·
Will Java 8 Kill Scala?
- dkuntz2 13y ago"Java 8 has lambdas. Scala has lambdas. Obviously we have to ask the question... Oh wait, Scala has other stuff too..."
- thejosh 13y agoObligatory http://en.wikipedia.org/wiki/Betteridge's_law_of_headlines http://en.wikipedia.org/wiki/Betteridge's_law_of_headlines
- mpyne 13y agoNo. Next question...
- kenrose 13y agoI mean, the title is kind of link-baity. But the article even answers the question: "What about type inference, traits, vals, implicits, case classes, value classes, static objects, pattern matching, type variance, macros, immutable datatypes, lazy vals, existential types, higher-kinded types, type classes."
- frostmatthew 13y ago> I mean, the title is kind of link-baity. Agreed, Why Java 8 is actually good for Scala (or even Java Folks, Welcome to Planet Lambda!) would have made a better (though less link-baity) title
- deleted 13y ago[deleted]
- ajkjk 13y agoIf you're like me, who uses a lot of Java but hasn't learned Scala, then - no, it's not so obvious. The title was exactly a question I suppose I had.
- eranation 13y agoI think the article is worth reading albeit the baityness of the title, the OP's conclusion is by the way: > So, I don't think Java 8 will Kill Scala by any means. And he gives valid and compelling reasons why.
- justinsb 13y agoIt isn't that Java 8 will kill Scala, it is that Scala has demonstrated the utility of lambdas to the point where they can safely be incorporated back into Java. So Scala has "won", but in my opinion likely Scala will now fade away. Java is necessarily very conservative with adopting language features, because it is very careful to maintain backwards compatibility. Java is a bit like Debian stable - out of date compared to Debian testing or even other distros - but solid as a rock. For features to make it into Java, they really need to be proved first in other languages or in external libraries. This isn't the first time Odersky has advanced Java either - he worked on Pizza, which showed how to add Generics to Java. Scala demonstrates how to add functional features to Java. Generics were a huge advance, and I think lambdas will be as consequential. So if Scala does die, it will be as a sacrificial lamb, rather than as a casualty of an unseen war.
- saryant 13y agoI like to think of lambdas as the hook that shows Java developers how Scala can help their code but its other features are what make them stay. As the article says, "type inference, traits, vals, implicits, case classes, value classes, static objects, pattern matching, type variance, macros, immutable datatypes, lazy vals, existential types, higher-kinded types, type classes". (Pattern matching is amazing, I don't know how I lived without it)
- justinsb 13y agoAgreed: there's definitely still more features in Scala. But Java has taken "Scala - the good parts"; or at least, what they consider the good parts. That'll be enough for many people, and my guess is it will suck the air out of Scala's room. I do consider some of those other features important, and wish we could have them in Java, but they aren't as well-proven yet. (For me, it is easy immutable classes; I like pattern matching but can cope without it.)
- eranation 13y ago> But Java has taken "Scala - the good parts"; I respectfully disagree. if anything did that, it was Kotlin.
- yati 13y ago> "the world's most advanced type system that no language can compete with so far." While I love Scala, I'm yet to see a better type system than Haskell's.
- lmm 13y agoIn Haskell, typeclasses are special-cased and you can only have one implementation for a given type. In Scala, typeclasses arise naturally as a pattern out of more primitive building blocks, and are "just another type" that you can pass around and manipulate in ordinary ways.
- eru 13y agoTry Agda.
- bad_user 13y agoJava 8 has the potential to kill languages that were designed with the purpose of being a "better Java". Scala ain't one of them. Clojure ain't one of them either. Surely some people that just want Java with closures will not move to Scala anymore. Some people that moved because they wanted a better Java, may move back to Java, because Scala is actually painful when used as a better Java. But Scala will thrive, as it's a very well designed language that achieves the best combination between OOP and FP available. In fact Java 8 is good news for Scala, because of the JVM improvements and because Java developers will be more comfortable in consuming libraries built with Scala, like Play and Akka. This is extremely good news, because with the Java ecosystem being so massive, Scala will gain more users than it will lose once people start seeing the possibilities.
- pjmlp 13y agoActually I think Java 8 will scare a lot of average skill cog developers still stuck on Java 1.4 - 6 world. I just wonder to which language such soulless corporations with move to. Edit: Why the downvotes?! I do like Java 8. Just thinking out loud about those soulless corporations I happen to visit from time to time in consulting gigs.
- deleted 13y ago[deleted]
- larsmak 13y agoOne great thing about these new language features is that you don't have to use them. You can run on jdk8 and program as if it was your grandmas vm. This was true for generics and will be true for lambdas etc. As programmers become more advanced they understand the need for the more advanced features and start to adopt them - but they are not strictly required from the start.
- bad_user 13y agoTo be fair, Java's generics are so awfully implemented that I stay away from them as much as I can - i.e. invariant, with use-site variance notations by means of existential types and freaking wildcards (instead of declaration-site like how Scala does it, which is much saner). I mean, take a look at this presentation: http://parleys.com/play/514892250364bc17fc56bb15/chapter0/about http://parleys.com/play/514892250364bc17fc56bb15/chapter0/ab... And I'm not even ranting about the generics being based on type-erasure, like so many other people are doing. Type-erasure is actually one of the best features of Java, since reification implies doing damage in the runtime which would have impacted other languages and with a good type system, you wouldn't need reification anyway.
- _pmf_ 13y agoScala can safely assumed to collapse under its own weight. Growing a language by gluing on arbitrary features is not a very smart move.
- frowaway001 13y agoLike what?
- mcv 13y agoI think it'll collapse under the weight of its type system. The rest of Scala is great.
- thescrewdriver 13y agoThe blog itself basically says that the answer to the question is a rather obvious No.
- CmonDev 13y agoMaybe using OCAML as a base for F# was a smart move. It seems C# and F# will be more different than Java and Scala. Yet F# is not different enough to justify the move in many cases.
- ninjazee124 13y agoI used Scala at my previous startup, but for my new startup I decided to build the backend in Java 8. Biggest reasons were the tooling/IDE is just miserable in Scala and the lack of developers in the market. I am really happy with my decision to build our backend with Java 8, quite a joy to write lambda expressions and have the tooling of Java. Pretty sure I won't be going back to Scala.
- mark_l_watson 13y agoWhat are you working on for your new startup? I think that Java 8 is such a large improvement that I will use Java more often, and use Clojure less often for back ends.
- ninjazee124 13y agoThe backend stack is entirely Java 8 built on top of Spring 4 eco system.
- deleted 13y ago[deleted]
- mcv 13y agoScala is a lot more than lambdas. For one thing, Groovy also has lambdas. They weren't remotely unique to Scala. The real power of Scala comes from other things, like how you can use the combination of case classes and the builtin data extracting pattern matchers to easily pass complex messages around. That is something special. Lambdas are dead common. They're in practically every language other than Java, and now finally even Java has them. It's good that Java now gets them too, but if that was enough to kill Scala, then Scala wouldn't have been anything special.