4 ms·
I don't get the equation of Scala and Kotlin and Ceylon. Ceylon and Kotlin grab the low-hanging fruit. They are better Javas. These languages bring nothing new
by DCKing 12y ago
I don't get the equation of Scala and Kotlin and Ceylon.
Ceylon and Kotlin grab the low-hanging fruit. They are better Javas. These languages bring nothing new to the table at all. They will actually suffer from Java 8, because Java 8 itself is a better Java like they are. People write Kotlin and Ceylon because they need to write a Java app but they don't want to write Java.
Scala is not meant to be a better Java. It can be used in that way, but it's not meant to be. It has a vastly richer set of features, probably one of the most sophisticated type systems of any language, and a growing number of Scala-specific libraries. In addition to people writing Scala because they don't want to write Java, there exist many people that want to write Scala because of Scala.
The same general argument seems to apply to Clojure. Just because your language runs on the JVM doesn't mean it's just an alternative for Java.
(This is not to say that I don't think Kotlin at least is shaping up to be a beautiful language.)
- pron 12y agoThe question is one of numbers. How many Scala developers use it as a better Java, and how many use it for its "richer set of features". The first group would likely benefit more from Kotlin (as those other features are, IMO, Scala's Achilles heel), and if that group is the larger one (and I suspect it most certainly is), then Kotlin is in direct competition with Scala. As to "bringing nothing new to the table at all", I'm not sure about that. It depends on your definition of "nothing" and "something". I think they certainly bring convenience, and their[1] switching costs are orders of magnitude lower compared with Scala's. The question is, then, is the "something new" Scala brings worth the price. Again, the answer to that depends on the user. Some will think it most certainly is; others will find the cost way too high. [1]: Well, Kotlin's; not Ceylon's
- lmm 12y ago> their switching costs are orders of magnitude lower compared with Scala's. How so? Scala may have more ways for features to interact and I guess a larger library ecosystem to become aware of (though it seems perverse to count a large library ecosystem as a downside), but IME most of the cost of switching is in tooling support and finding a developer community to answer questions - both areas where Scala is far ahead of something like Kotlin.
- pron 12y agoBecause if you have a Java project, it's trivial to write a few classes in Kotlin. It feels perfectly natural to have a mixed Java/Kotlin package. Integration is seamless. Scala/Java integration, OTOH, is a pain, especially if you want it to feel natural in both languages, or even only in Scala. Even Clojure/Java integration is easier than Scala/Java integration.
- DCKing 12y agoClojure has beautiful Java interopability for a Lisp, and Java really does break down idiomatic Scala a lot. But that last sentence is way too hyperbolic.
- DCKing 12y agoIt's maybe even wrong of me to lump Ceylon and Kotlin together. Kotlin definitely is richer (and closer to Scala in features) and can also compile to JavaScript, which puts it in a different boat. As a straight and immediate Java replacement, I'd definitely recommend Kotlin as well. If you want to switch over existing Spring apps, you will not get the best out of Scala. Scala, in my experience, is most effective when written without Java goggles on. But Scala definitely has large advantages for new projects or broad refactorings.
- lmm 12y agoCeylon also targets compile-to-javascript. (I thought Kotlin kept the standard Java library - have they compiled a version of that for javascript or what?)
- pron 12y agoI'm not sure about Kotlin's plans re Javascript standard libraries, but I guess the approach is similar to Clojure, i.e. being a "hosted language" aimed at easy integration with the host environment (plus a very basic "common" standard library).
- lmm 12y agoIf anything that makes it less reliable for compile-to-javascript than Ceylon, no? (AIUI Ceylon abandons the Java standard library in favour of its own, partly so that you have the same standard library for either target).