Most active commenters
  • still_grokking(9)
  • Rogach(4)
  • dionian(3)

←back to thread

Scala 3 slowed us down?

(kmaliszewski9.github.io)
261 points kmaliszewski | 32 comments | | HN request time: 0.029s | source | bottom
1. hunterpayne ◴[] No.46185337[source]
The problem with Scala 3 is that nobody asked for it. The problem with Scala 2 is that the type inference part of the compiler is still broken. Nobody worked on that. Instead they changed the language in ways that don't address complaints. Completely ignore the market and deliver a product nobody wants. That's what happened here.

PS Perhaps they should make an actual unit test suite for their compiler. Instead they have a couple of dozen tests and have to guess if their compiler PR will break things.

replies(9): >>46185583 #>>46185595 #>>46185634 #>>46185790 #>>46187159 #>>46187881 #>>46188031 #>>46190120 #>>46197778 #
2. thefaux ◴[] No.46185583[source]
It's sad but I generally agree. Scala was in my view pretty well positioned for an up and coming language ~2010-15. Not only did the scala 3 rewrite fail to address many of the most common pain points -- compile times and tooling immediately come to mind -- the rewrite took many years and completely stalled the momentum of the project. I have to wonder at this point who is actually starting a new project in scala in 2025.

It's really a shame because in many ways I do think it is a better language than anything else that is widely used in industry but it seems the world has moved on.

replies(3): >>46186436 #>>46190032 #>>46197869 #
3. oelang ◴[] No.46185595[source]
And I wish you read the article, you're comments are completely off topic.
4. voidfunc ◴[] No.46185634[source]
Scala has deep roots in the Ivory Towers of Academia, its not shocking they think they know better than their users what the problems with the language are and didn't do any kind of real product management to figure out the actual problems before embarking on a rebuild.
replies(1): >>46190700 #
5. lispisok ◴[] No.46185790[source]
I tried getting into Scala several times and kept going back to Clojure. Unless you are into type system minigames Clojure has many of the things Scala advertises but without the dumptruck of Scala overhead and complexity. Another commenter briefly touched on this but it's a language made by academics for academics to play with language design. It was a little weird it blew up in industry for a while.
replies(3): >>46186499 #>>46188220 #>>46197878 #
6. zahlman ◴[] No.46186436[source]
>It's sad but I generally agree. Scala was in my view pretty well positioned for an up and coming language ~2010-15

I used Scala for a bit around that period. My main recollection of it is getting Java compiler errors because Scala constructs were being implemented with deeply nested inner classes and the generated symbol names were too long.

replies(1): >>46197633 #
7. acjohnson55 ◴[] No.46186499[source]
> it's a language made by academics for academics to play with language design. It was a little weird it blew up in industry for a while.

Yep. They have always been pretty honest about this.

I think that it blew up in industry because it really was ahead of its time. Type systems were pretty uncool before Scala. It proved that you could get OO and FP in a single type system.

Actually, a big part of reason for doing Scala 3 was rebasing the language on a more rigorous basis for unifying OO and FP. They felt that for all their other big ideas, it was time to rethink the fundamentals.

replies(1): >>46186671 #
8. refulgentis ◴[] No.46186671{3}[source]
> Type systems were pretty uncool before Scala

I’m not up on programming language engineering as much as I should be at 37, could you elaborate a bit here? (To my untrained ear, it sounds like you’re saying Scala was one of the first languages that helped types break through? And I’m thinking that means, like, have int x = 42; or Foo y = new Foo()”

replies(1): >>46187108 #
9. hunterpayne ◴[] No.46187108{4}[source]
Not types, type-safety. Things like covariant and contravariant type declarations, implicit types (variables looked up by type instead of by label), and other things that you need to make a type safe system/service/application. The problem is that that feature of a language is massively oversold. Its nice but to pretend it prevents bugs or is even a great design goal is questionable and not backed up by research (as they claim).
replies(2): >>46188224 #>>46197934 #
10. lmm ◴[] No.46187159[source]
> The problem with Scala 2 is that the type inference part of the compiler is still broken. Nobody worked on that. Instead they changed the language in ways that don't address complaints.

Huh? Type inference is much more consistent and well-specified in 3. In 2 it was ad-hoc so and impossible to fix anything for one codebase without breaking another. There are plenty of legitimate complaints to be had about Scala 3, but this is absolutely not one of them.

11. ergocoder ◴[] No.46187881[source]
You capture the root issue quite well.

Now every tool has to adapt to Scala 3. And you guess it? It will take time. Even IntelliJ still doesn't correctly highlight syntax on some parts that also exist in Scala 2. And this has been years after Scala 3 was launched. It's mind-boggling.

They could have improved upon Scala 2 and incrementally add more capabilities. It's obvious they don't care about Scala's industry success. They care mostly about the academic success. Nothing wrong with that, but that should be made very clear.

In Scala, they have a huge debate with zealots arguing against, for example, early return; they would describe how bad it will be blah blah blah e.g. https://tpolecat.github.io/2014/05/09/return.html, meanwhile Kotlin supports early return with absolutely no issue.

12. monksy ◴[] No.46188031[source]
It was absolutely amazing how stubborn and ridiculous the whole bracket-less syntax change was handled. It was basically a dictatorial decision that they pretended to be a community decision. It was just pushed and tons of people voiced their disapproval. In the end it was "so bad so sad you can always reenable brackets".

They did it to try to appeal to Pythonists.. turns out that wasn't why Pythonists didn't use scala in the first place.

replies(2): >>46188215 #>>46197989 #
13. dionian ◴[] No.46188215[source]
I think it’s nice to be able to use it. But like pretty much everything in scala, it’s a huge smorgasbord of things from which you can choose. I personally don’t use that syntax, but it’s cool that I can and sometimes I do just for fun.
replies(1): >>46190905 #
14. dionian ◴[] No.46188220[source]
The simplicity of closure is certainly a main part of its appeal. I’ve never done OOP in it, but I don’t think I want to. I have a lot of respect for it though.
15. dionian ◴[] No.46188224{5}[source]
But it’s still a way more powerful and expressive type system than Java. So using it in a JVM ecosystem is a perfect fit.
16. theLiminator ◴[] No.46190032[source]
> It's really a shame because in many ways I do think it is a better language than anything else that is widely used in industry but it seems the world has moved on.

I'm really hoping that https://flix.dev/ will learn from the mistakes of Scala. I t looks like a pretty nice spiritual successor to Scala.

17. vletal ◴[] No.46190120[source]
I was so stoked, when it was released. Loved the approach they take. So, I can say, there was at least one person who asked for it.

With the hindsight, it is not a great mainstream language and the new opinionated language is too hard for junior Joe developers.

Anyway, you clearly have not read the article, as it is about bug in a transitive dependency, not an actual Scala 3 issue.

p.s.: Scala compiler is one of the most aggressively tested pieces of software in the JVM ecosystem.

18. js8 ◴[] No.46190700[source]
It wouldn't be a problem, but the issue is a one of expectations.

Was Scala supposed to be a research language (focus on novel features) or an industrial language (focus on stability and maintainability)? I think Oderski wanted the first but many people wished for the second.

19. jll29 ◴[] No.46190905{3}[source]
A language should not be complicated. (Wish Odersky, capable as he is, kept working on his much-verlooked TurboModula).

Simple:

- Scheme

- C

- Pascal

- Go

- Lua

Complicated

- PL/1

- C++ 2024

- Scala 3

Still borderline or beyond?

- Rust

- Java (>850 pp. lang. specification...)

replies(1): >>46198101 #
20. still_grokking ◴[] No.46197633{3}[source]
> My main recollection of it is getting Java compiler errors because Scala constructs were being implemented with deeply nested inner classes and the generated symbol names were too long.

Sounds like you've used some beta version over 15 years ago.

Nothing like described happens in current Scala and it's like that as long as I can think back. Never even heard of such bugs like stated.

Coming up with such possibly made up stuff over 15 years later sounds like typical FUD, to be honest.

21. still_grokking ◴[] No.46197778[source]
> PS Perhaps they should make an actual unit test suite for their compiler. Instead they have a couple of dozen tests and have to guess if their compiler PR will break things.

You did not even try to formulate it in a way that could be interpreted as you just not knowing; instead you make blatant false statements in the most confident way possible.

Your statement is therefore an outright lie, spreading FUD.

As a matter of fact the Scala compiler has thousands, likely even tens of thousands of test cases.

https://github.com/scala/scala3/tree/main/tests

But that's not all. Scala (2 & 3) has also a test case called "community build" where new compiler releases are tested by compiling millions of LOCs from all kinds of Scala OpenSource projects.

https://github.com/VirtusLab/community-build3

https://github.com/scala/community-build

22. still_grokking ◴[] No.46197869[source]
> It's really a shame because in many ways I do think it is a better language than anything else that is widely used in industry but it seems the world has moved on.

No it didn't. Scala is powering some of the biggest companies on this planet.

https://business4s.org/scala-adoption-tracker/

It does apparently so well that nobody is even talking about it…

So it seems even better than all the languages people are "talking" (complaining) about.

23. still_grokking ◴[] No.46197878[source]
> It was a little weird it blew up in industry for a while.

It never went away. It only got more:

https://business4s.org/scala-adoption-tracker/

replies(1): >>46202318 #
24. still_grokking ◴[] No.46197934{5}[source]
> Its nice but to pretend it prevents bugs or is even a great design goal is questionable and not backed up by research (as they claim).

That's why people use JavaScript instead of Rust for critical systems, right?

Claiming in the year 2025 that strong static types don't provide massive advantages is almost laughable, TBH. This was settled long ago, and the whole industry now understands that type safety is inevitable to create reliable and scalable systems.

25. still_grokking ◴[] No.46197989[source]
> In the end it was "so bad so sad you can always reenable brackets".

This is not true.

Nobody ever proposed to replace the old syntax!

The new syntax was, and is, optional, and that's exactly like designed from the very beginning.

replies(1): >>46202419 #
26. still_grokking ◴[] No.46198101{4}[source]
Extremely weird list.

The Scala spec is much shorter than the C spec… Also it's of course much shorter than Rust, where nobody has a real issue with its complexity, at least nobody is complaining really loudly.

The C and Go specs are actually extremely involved, long, and complex given that the languages almost don't have any features at all.

But comparing language specs isn't a 100% fair metric.

One should instead look at formal language semantic definitions written all in the same way.

If you look at these you will for example learn that the C semantics are much more complex than for example Java.

Check out https://kframework.org/ to learn more. (A list of semantics for different languages can be found on the "projects" sub page).

27. Rogach ◴[] No.46202318{3}[source]
Wow, 34 companies with "possibly" 233 more!

I don't see the chart with changes of number of companies using Scala over time. But even without the chart - if after 15 years there are less than 300 companies in total, that's a bit depressing.

Of course legacy never goes away, and even 20 years down the line there will still be some demand for Scala programmers. Similar to how Cobol still lives on. But in my experience the language isn't growing anymore, even slowly dwindling in userbase. And this became way worse after Scala 3 mess.

replies(1): >>46211581 #
28. Rogach ◴[] No.46202419{3}[source]
They didn't explicitly propose replacing the syntax, true. But to an outsider, it sure looked like the new syntax was a priority - all the examples and code snippets in the official docs defaulted to the new syntax, making them infuriating to read for someone accustomed to braces.

If I recall correctly, later they added a switch allowing one to choose between syntax versions in the online docs. But it wasn't done right from the start, and when that was finally added most of the damage was done, people already lost interest.

I understand that removing braces might feel harmless - but it really makes the code harder to read for people that use braces all the time.

If someone's brain is accustomed to seeing braces everywhere, reading code with them becomes almost automatic, handled by "low-level" parts of the brain. If the syntax is changed, then "low-level" brain areas have to pass work to "higher-level" areas, which increases energy requirements and processing latency. So reading unfamiliar syntax is literally harder.

Incidentally, that's also why many people are so picky about grammar - grammatical errors make the text noticeably harder to read.

Source: have a degree in neurophysiology.

replies(1): >>46211506 #
29. still_grokking ◴[] No.46211506{4}[source]
Examples and code snippets in the official docs of course default to the new syntax, making them well readable for all people accustomed to Scala's new syntax.

> If I recall correctly, later they added a switch allowing one to choose between syntax versions in the online docs.

Stating this, which is not, and never was true creates the impression you're talking about things you have no clue about.

The point is: Removing braces really makes code much easier to read for people who get distracted by useless line noise!

> So reading unfamiliar syntax is literally harder. > […] > Source: have a degree in neurophysiology.

You need a degree to understand something such obvious? Never mind…

The point is: New syntax is only new in the first few hours of contact with it.

Anybody who uses more than one language knows that switching languages is in fact a bit distracting, but at latest on the second day you completely stop thinking about syntax, and than switching back to whatever was before is as hard as the previous switch to the current thing. Usually this happens already after a few hours for languages you already know.

As we're talking about neurophysiology: As a matter of fact filtering "noise" — irrelevant information — from sensory input is a hard task for the brain. So having less distracting useless noise in the input helps to concentrate on the stuff that actually matters!

Braces in code are 100% redundant, useless noise. The only reason they were added in the first place was to make code simpler to parse for computers, something that does not matter any more since many decades. So there is no rational reason any more to pollute code with useless, distracting noise.

replies(1): >>46214366 #
30. still_grokking ◴[] No.46211581{4}[source]
The website is a private undertaking which started literally a few days ago. It's not some official complete tracker.

The point was to show that big corps are dependent on Scala, often at their core.

Scala is likely not for everybody, but where you need to write safe high level code there is more or less no alternative, not even on the horizon. Scala is simply very likely where Rust will end up after the honeymoon, when people realize that feature rich, safety first languages aren't for the mass market, where mostly only the cost of initial development counts.

replies(1): >>46214360 #
31. Rogach ◴[] No.46214360{5}[source]
True, Scala (the language) offers lots of great functionality. And Scala 3 brought some important improvements.

But safety is not the only important aspect of a programming language. For me personally the community (libraries, tools, forums, blogs, etc) became much more important over the years, and I feel that Scala 3 really hurt the community angle.

32. Rogach ◴[] No.46214366{5}[source]
I feel that I need to preface my answer with the defusing disclaimer: I understand that you love the language very much. And statements like the ones I make may hurt, because they say bad stuff about the thing you love. But getting defensive might detract from otherwise interesting discussion.

In fact, I also love Scala. I've dedicated lots of my time to working with it (almost 15 years at this point!), I've been with it since 2.8.x days. And I really lament that it fell out of favor and huge swaths of the community left.

> Stating this, which is not, and never was true creates the impression you're talking about things you have no clue about.

Of course it is possible that I have misremembered, so I went and checked. It was a mistake on my part to make such a statement and not to provide an actual link.

Not only it was that way, it actually still is. See the official Scala 3 reference: https://docs.scala-lang.org/scala3/reference/

All the code examples there use the new syntax. And I would guess that "Scala 3 reference" is the document that Scala 2 veterans (like myself) would have been using when learning about new features and contemplating migration to the new version.

> You need a degree to understand something such obvious? Never mind…

It might be obvious, but I felt that it wasn't obvious to some people (including the ones that were in charge of the documentation for Scala 3), so I wanted to expand a bit on that.

> The point is: New syntax is only new in the first few hours of contact with it.

Of course, but these "first few hours" are exactly the hours that were spent reading the documentation for the Scala 3, and I feel that making those hours harder wasn't the smart choice.

I think that Scala development team made a decision to chase growth, focusing on attracting new users and disregarding the old ones. Looks like they lost that bet - new users didn't come, and many old users were disappointed and left.

New syntax isn't the only problem of Scala 3, and probably it isn't even the biggest one. But it was the most glaring and visible issue - for me, almost every code example in the reference really felt like a spit in the face. Exactly this kind of off-hand dismissal of old-time users was one of the reasons some of the users started moving away from Scala (myself included).

> Braces in code are 100% redundant, useless noise.

The debate about "braces vs significant whitespace" is raging literally for decades. Like many similar debates, it seems that there's no "true solution" and no "true winner" - both sides have heaps of valid arguments.

I assume that both sides have their merits, and it's always a tradeoff between pros and cons of each approach. I use languages that have braces, and I use languages that use indentation - I see pros and cons of each approach. Outright dismissing the other side of the debate by saying that it's "100% useless" seems to be missing lots of nuance.