4 ms·
I definitely agree that many newer languages are strongly inspired by Scala, but I don't see a strong argument for why to choose Scala over one of a newer hybri
by occupy_paul_st 6y ago
I definitely agree that many newer languages are strongly inspired by Scala, but I don't see a strong argument for why to choose Scala over one of a newer hybrid language. My own intuition is that these newer languages have had the benefit of being able to learn from Scala's mistakes. A lot of them have intentionally sacrificed some of the Scala's flexibility to be easier to learn and use.
I found Scala to be an extremely enlightening language: it taught me a lot about functional programming. But, the complex type system and the sacrifices needed to ensure Java compatibility entail many quirks that I find frustrating. I think it's actually a similar dynamic to what you mention: "retro-fitting these features onto an existing language never fits quite as nicely as a language that was designed with them from scratch."
BTW, I am a huge fan of your writing: the Principle of Least Power is a sacred programming text to me .
- playing_colours 6y agoWhat newer hybrid languages besides Kotlin can cover the benefits you can get with Scala: a solid ecosystem (both for Scala and Java) for developing web applications, microservices, data processing, and good performance. Julia, Rust, and Elixir are all great, but popularity, ecosystem are not there yet.
- dunefox 6y agoFor Julia there are PyCall and RCall, so the ecosystem is less of an issue than with other languages. Also, its ecosystem has been growing quickly over the last 2 years or so. https://github.com/JuliaPy/PyCall.jl https://github.com/JuliaPy/PyCall.jl https://github.com/JuliaInterop/RCall.jl https://github.com/JuliaInterop/RCall.jl
- jolux 6y agoF#
- lihaoyi 6y agoI actually came to Scala via F#. You can even find exact dates of those transitions in my stackoverflow history. Scala and F# are sinilar enough to basically be the same language, though I found F# had a number of warts and idiosyncracies that made me move on to Scala. Scala didn't have all of these (though of course it had warts of its own!) and is what stuck with me for the long term
- smabie 6y agoF# has a much more primitive type system than Scala and isn't particularly impressive imo. And it doesn't have functors ala OCaml.
- jolux 6y agoWhat I like about F# vs Scala is the ML-style syntax and the relative simplicity. I have found Scala staggeringly complex every time I have tried to learn it, it seems like the C++ of functional programming languages. This impression may be misguided.
- occupy_paul_st 6y agoI actually haven't seen a language that can do everything that Scala can do, so in a lot of senses I agree with you! The alternative is to use multiple different languages to fill different niches. In theory this sounds suboptimal but I think it might actually be easier to learn multiple simpler languages than it is to learn Scala. BTW according to PYPL: Swift, Kotlin, TypeScript, and Rust are now more popular than Scala. https://pypl.github.io/PYPL.html https://pypl.github.io/PYPL.html
- didibus 6y agoI've switched to Clojure, it covers all those basis.
- pegasus 6y agoScala has learned from Scala's mistakes too. Scala 3 cleans up a lot of the mess that had accumulated over the years and is on the cusp of being rolled out this month.
- imtringued 6y ago>the sacrifices needed to ensure Java compatibility entail many quirks that I find frustrating. That reminds me of that dead JVM language called Ceylon. It didn't compromise anything to ensure Java compatibility. The combination of OOP+FP was executed with zero friction. Meanwhile Scala did it so poorly it created a stupid myth that OOP and FP shouldn't mix. Of course everyone knows that nobody used Ceylon, not even Redhat who sponsored the language. The compiler was also dog slow. Typechecking complicated type unions/intersections can get really slow with bigger projects. The metamodel also created a lot of JS bloat if you were brave enough to use it in the browser. Lots of practical complaints that ultimately make you stop using it. But oh man the idea and design. It was very well thought out and enjoyable to program in.
- stickfigure 6y agoCeylon was (is?) really beautiful. At least type unions/intersections found their way into Typescript. IMO Gavin's biggest mistake was picking Eclipse for the IDE platform at a time when every professional was moving to IntelliJ.
- valenterry 6y agoAnd into Scala 3 too!
- lmm 6y ago> I definitely agree that many newer languages are strongly inspired by Scala, but I don't see a strong argument for why to choose Scala over one of a newer hybrid language. My own intuition is that these newer languages have had the benefit of being able to learn from Scala's mistakes. A lot of them have intentionally sacrificed some of the Scala's flexibility to be easier to learn and use. I don't believe any of those new alternatives has made better choices; some of them haven't had time to accumulate as many warts as Scala yet, but all of the ones I've seen have design decisions that make them inevitable. Higher-kinded types still work much better than every other way of achieving the same things that's been found - and if you want both higher-kinded types and decent tooling/library support, Scala is still pretty much the only option. (Haskell exists, but even if you consider its tooling good enough, implicit pervasive laziness has huge costs).
- Cthulhu_ 6y agoI feel like Scala started a trend in language design, where every language adds features from other languages. Not because there's a need, but because some people are used to language X. Example: adding OOP in PHP and Javascript. In both examples, especially the first attempts, were half-baked. Why bolt on half a language feature? Both languages would be much better served with dependency management and / or modules, which for both languages came out of the community at first. Counter-example would be Go, that resists change - especially if it's requested with a "this feature is in language X! I NEED it!". From the FAQ: https://golang.org/doc/faq#Why_doesnt_Go_have_feature_X https://golang.org/doc/faq#Why_doesnt_Go_have_feature_X (followed by some features other languages have. Generics / type arguments is one that will probably be added in an upcoming version of Go, but they only considered it once they fully understood the problem and need)
- mrkeen 6y ago> Counter-example would be Go, that resists change It will happen, just slower. Just as half-baked.
- valenterry 6y ago> Counter-example would be Go, that resists change Now it gets generics, so we are one step closer to Scala. :)
- mbo 6y agoEven with square-bracket syntax!
- still_grokking 6y agoJavaScript was OO form day one. There aren't even much languages that are so consequent OO like JavaScript. Everything is an object even functions. JavaScript is actually quite similar to Self (besides the syntax), which itself is a kind of a SmallTalk like language. It's hard to be more OO than that. :-)
- davnn 6y ago> BTW, I am a huge fan of your writing: the Principle of Least Power is a sacred programming text to me . That principle is actually directly from the CTM book, which seems to have been a great inspiration for Martin Odersky in the language design.
- yawaramin 6y ago> I don't see a strong argument for why to choose Scala over one of a newer hybrid language. Scala has been in production use and getting bugfixes for longer than some of the newer languages have existed. I feel like a re-read of https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/ https://www.joelonsoftware.com/2000/04/06/things-you-should-... is warranted.
- still_grokking 6y agoI to this day don't get what's wrong with Scala's marketing, as people are complaining about the "complex type system" but nobody does so for TypeScript. Same for compile times. TS compilation is ridiculously slow yet there're no complains whatsoever out there. Scala compile times are OK on the other hands side, especially if you ever used C++ with similar complex code, or TS like said, but "the slow compiles" are a topic now for years. Just makes no sense to me, don't get it.