4 ms·
Scala is not cool in any way, shape or form. It’s an unsuccessful, niche language, that has implemented probably every possible feature ever done in a programmi
by Kwpolska 4y ago
Scala is not cool in any way, shape or form. It’s an unsuccessful, niche language, that has implemented probably every possible feature ever done in a programming language, including some really backwards ones (like putting XML in the middle of your code). Having all those features makes Scala harder to learn and understand. Programming language features aren’t “stolen”, since they aren’t really “owned” by any given language.
- nradov 4y agoYou're getting down voted but your comment is basically correct. Scala contains some good ideas but due to high complexity and weak tooling support it has failed to gain mainstream adoption. And it's widely recognized now that embedding XML literals in the code was a bad idea; if we want to do something like that then it should be a more generalized mechanism that could support other hierarchical data formats such as YAML or JSON instead of being locked in to XML. Despite its flaws, Scala isn't a bad language necessarily. It will still continue to see niche use. But it no longer seems like the obvious path forward for general purpose application coding.
- Kwpolska 4y agoI don’t think a generalized mechanism that would simultaneously suport XML and JSON would work, because they have different structures, uses, and generation/parsing mechanisms (XML/HTML is often generated using textual templates, but JSON is generated and parsing by going by plain old objects. While Scala is perhaps not a “bad language”, it contains many flaws and I don’t see much of a bright future for it. (Also, Scala 3 brings new single-use features, and an entire alternate Python-style syntax, because learning one syntax is apparently not enough.)
- nradov 4y agoMy point was that XML and JSON (and YAML and S-expressions) are fundamentally similar in that they can be modeled as tree structures. So, in principle it might be possible for a programming language to have generalized support for tree structured data literals which could then be encoded into multiple different external formats. As to how that could work syntactically without turning into a huge mess, I'm not sure.
- SillyUsername 4y agoThe only company I've ever known to use Scala in a big way, based on their job ads, is Disney Streaming. Now their streaming service is successful and stable, so it clearly was the right choice for them, but honestly I can't help but think they chose the runt of the litter. I imagine it's a developer who wanted the latest fad functional language on their CV many years ago, abandoned the company (or got promoted out of the dept.), and now Disney's current developers have to support a language that is mostly not idiomatic with the OOP libraries it uses, and lacks the userbase and support other languages enjoy.
- JackFr 4y agoHonestly I've used Scala in production in 3 separate companies and ten years ago everyone realized that XML in the code was a terrible idea. No one serious does it. I'm working in Java now, but I thought Scala was fantastic. The problem was that it attracted functional programming puritans and the category theory astronauts -- both groups had some really good ideas -- but pragmatism is at odds with elegance and focusing on delivering business value versus developing knowledge of theory can be a tough balancing act.
- cutler 4y agoYes, around the same time Scala was really big in the London financial sector with Morgan Stanley championing the language. The Guardian's back-end also runs mainly on Scala. There were also monthly Hack The Tower all-day Saturday meetups for Scala and Clojure and the turnout for Scala was much higher than for Clojure though both had a decent crowd. The scene is lot less colourful since these days. All we have is Node and Python meetups, ie. boring stodge.
- lmm 4y agoAs a Scala user, every other language out there is still a painful step back. Kotlin or Typescript or even Rust are painful once you're used to having HKT and real monads. And while Haskell-the-language is good, if you think Scala tooling is bad.... I predict Scala will see an upswing for the same reason that OCaml has been on an upward trend in recent years; even if a language is no longer unhyped, if it's well-designed then it still ends up being the best way to get things done. (The XML thing is a ten-years-out-of-date talking point, FTR)
- cutler 4y agoI predict the opposite and for the very reason you inadvertently suggested. The more Scala devotees obsess about HKT and dream of Haskell in their sleep the less relevant to business Scala will remain.
- lmm 4y agoHKT is the means, solving cross-cutting business concerns without fragile hacks (like reflection or metaclasses) is the end. If you use a language without HKT, you will have those flaky hacks in your codebase (because the alternatives are worse), you will have outages because of them, and your business will suffer (admittedly maybe not by enough to matter, depending what business you're in). Think back on your last outage - it's a good bet that using Scala would've prevented it.
- cutler 4y agoIf that was the case dynamic languages would be non-starters. Believe it or not there are a lot of businesses, some quite large, which have been chugging along quite nicely on PHP or Ruby for over a decade. HKTs may be fun to play with but let's get them in perspective as nice-to-haves.
- lmm 4y ago> Believe it or not there are a lot of businesses, some quite large, which have been chugging along quite nicely on PHP or Ruby for over a decade. Sure, and they either follow extraordinary development practices, or they have outages basically all the time (e.g. the famous Twitter "fail whale"). Like I said, in some lines of work (probably far more than people on HN would like to think, frankly) you can get away with that.
- valenterry 4y agoThen can you explain why Scala's spec is so small? Even Java's spec is much larger. I'll tell you the answer: because the language is comparably well designed, with a lot of foresight, and the fundamental features work well together. Also you are totally right about XML. This was a total mistake and in fact already has been removed from the language - I think a few years ago. Maybe you still have the old Scala in your head? That would explain your post a bit I guess. > Programming language features aren’t “stolen”, since they aren’t really “owned” by any given language I agree with that though and I think it's great that Java is progressing. There is no shame in copying the good things.
- MajimasEyepatch 4y agoPart of the reason that Scala's spec is so small that so many features are incredibly generic. Concepts like implicit are overloaded in a bunch of different ways and give rise to powerful but complex patterns that you need to understand to use the language, even if they're not strictly required for it. And since all of these different features and patterns are optional, you end up with every Scala codebase using a slightly different subset of the language, and different communities evolving very different ways of doing things. Look at Spark code vs. ZIO code and it's like night and day in a lot of ways. Scala 3 improved the situation a bit by breaking the "implicit" concept down into a few discrete concepts, but the language is still incredibly expansive, despite the "look how few keywords we have" talking point. Honestly, I do think that modern Scala is very well designed. But unfortunately the ecosystem and tooling and corporate support for it never really got to the point where it feels like a practical choice for most teams.
- kaba0 4y agoZIO and other purist FP code bases are probably not the most common, but definitely not the most well loved aspect of Scala — pragmatic FP would be that, that uses local mutability when that is readable, but prefers an immutable public API.
- valenterry 4y ago
- MajimasEyepatch 4y agoIronically, that XML(ish)-in-code idea did survive in JavaScript, where embedding HTML in code with things like JSX is now pretty standard. But that's the rare case where a programming language is so deeply entwined with a markup language that it's natural to bring them together. XML proper is increasingly rare as a data format nowadays, so Scala's support for it feels like a strange relic of a bygone era.
- 62951413 4y agoIt's a pity its adoption is stagnant. But it was highly successful in at least two respects: * introducing Java developers to the world of FP about ten years ago (i.e. before JDK8 and Kotlin) with a lot of that knowledge transferable to Kotlin in particular * significantly influencing Kotlin and evolution of Java itself Don't forget that it also made Spark (and to a lesser degree Flink and Kafka) possible.
- cutler 4y agoSpark is still not compatible with Scala 3.2 unless you want to burn in dependency hell.