Live data from Hacker News

Scala 3 slowed us down?

kmaliszewski9.github.io

181–190 of 195 posts

Re: Scala 3 slowed us down?

#181
post #106

Earlier quoted context omitted.

> Everything is up to date with the new syntax as far as I'm aware. The Eclipse plugin isn't, and none of the newer IDE integrations is reliable.

There's still a working Eclipse plugin? Does Eclipse now support LSP servers? The most reliable Scala IDE is currently Metals (in VSCode, but other editors work, too). Metals uses directly the compiler for all code intelligence so it's as reliable as the compiler itself. https://scalameta.org/metals/ https://scalameta.org/metals/docs/#editor-support

> There's still a working Eclipse plugin?

For Scala 2, yes, or there was the last I looked. Still the best Scala development experience by some margin, sadly.

> Metals uses directly the compiler for all code intelligence so it's as reliable as the compiler itself.

Not my experience; maybe it theoretically should be but the integration/bridging piece is still flaky.

Re: Scala 3 slowed us down?

#182
post #163

Earlier quoted context omitted.

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 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, w…

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.

Re: Scala 3 slowed us down?

#183
post #164

Earlier quoted context omitted.

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 rig…

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: Removi…

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.

Re: Scala 3 slowed us down?

#184
post #136

Earlier quoted context omitted.

It bothers me that majority of languages ignores a nice python approach. `', '.join(any_str_iterable)`. Instead of supporting join for myriads of containers there is a single str method.

Python's approach is one of the most confusing ways to possibly do it. Not having proper, discoverable methods is super annoying, and I need to look it up every time anew I use Python because it's so unintuitive. Of course you can write a generic version of `mkString` (as this method is called in Scala), so it's also just one method no matter the container count. The Python weirdness is actually a direct result from…

From typing perspective there is no sense to have Container[T].join() -> str for any T.

Re: Scala 3 slowed us down?

#185
post #184

Earlier quoted context omitted.

Python's approach is one of the most confusing ways to possibly do it. Not having proper, discoverable methods is super annoying, and I need to look it up every time anew I use Python because it's so unintuitive. Of course you can write a generic version of `mkString` (as this method is called in Scala), so it's also just one method no matter the container count. The Python weirdness is actually a direct result from…

From typing perspective there is no sense to have Container[T].join() -> str for any T.

I agree, but from convenience perspective there is a lot of sense. Java Streams is actually a good example of a "correct" design, but not very convenient.

Re: Scala 3 slowed us down?

#186

The takeaway of upgrading your libraries when upgrading major language and framework versions applies beyond Scala. Especially when the libraries abuse magic language features (and far too many Scala libraries do) or otherwise integrate deep into the framework/language.

> Especially when the libraries abuse magic language features (and far too many Scala libraries do) Would you mind to explain what you mean?

The library that caused breakage for the OP is a good example: https://github.com/softwaremill/quicklens

Re: Scala 3 slowed us down?

#187
post #184

Earlier quoted context omitted.

From typing perspective there is no sense to have Container[T].join() -> str for any T.

I agree, but from convenience perspective there is a lot of sense. Java Streams is actually a good example of a "correct" design, but not very convenient.

That's my point. Python has convenient and good type design with str.join ignored by other languages.

For example I'm lost which abstract class to inherit in Scala to obtain mkString for my custom container.

Re: Scala 3 slowed us down?

#188

Earlier quoted context omitted.

I didn’t say that. I’m highlighting a specific challenge of getting predictable performance over the lifetime of code. Lower-level languages don’t have this same problem to the same extent. They have other problems Scala doesn’t have.

> Lower-level languages don’t have this same problem to the same extent. Of course they have. If the computer would directly execute what you write down in what you call "low level language" this would be slow as fuck. Without highly optimizing compilers even stuff like C runs pretty slow. If something about the optimizer or some other translation step of a compiler changes this has often significant influence on the…

They absolutely do not. The problem is three-fold.

1. The rules for when an optimization works and doesn't is complex and implicit (as seen in this post).

2. The magnitude of performance between getting an optimization and not is significant.

3. When it does fail, you have almost no recourse because you can't express your intent.

Now do C. You have problem 1, but not to the same extent. In rare cases you can see problem 2. And you never have problem 3.

Re: Scala 3 slowed us down?

#189

Earlier quoted context omitted.

> Lower-level languages don’t have this same problem to the same extent. Of course they have. If the computer would directly execute what you write down in what you call "low level language" this would be slow as fuck. Without highly optimizing compilers even stuff like C runs pretty slow. If something about the optimizer or some other translation step of a compiler changes this has often significant influence on the…

They absolutely do not. The problem is three-fold. 1. The rules for when an optimization works and doesn't is complex and implicit (as seen in this post). 2. The magnitude of performance between getting an optimization and not is significant. 3. When it does fail, you have almost no recourse because you can't express your intent. Now do C. You have problem 1, but not to the same extent. In rare cases you can see prob…

First of all nothing in the article is about optimization. Scala does not even have an optimizer…

It was about translation strategies and macro expansion.

But this makes no difference. You have all issues you just named exactly the same in so called "high level languages" as you have in C. C is in fact a high level language, and the code you write in C has not much in common with what the machine actually executes. The last time this wasn't like that is about 40 years ago.

1. Whether the C optimizer kicks in or not is pure dark magic. Nobody can tell from just looking at the code. The optimization techniques are way too complex to be understood ad hoc, not even experts can do that.

2. The difference between the optimizer doing its work, or instead the computer just verbatim executing whatever someone written down is hilariously large! Adding -O2 can make your code many orders of magnitude faster. Or it does almost nothing… (But like said, you can't know what will happen just from looking at the code, that's point again 1.)

3. You neither can express what the machine does in C. The machine does not execute anything like C. The last time it did is over 50 years ago… Since at least 30 years we have kind of JIT compiler in the CPUs which translate the result of compilation to ASM into the actual machine language. A modern CPU needs actually to emulate a computer that still works like a PDP-11 to match the C machine model even the real hardware does not look anything like a PDP-11 any more! You have only very indirect influence on the actual machine code when writing C. It's mostly about forcing the CPU internal JIT to do something, but you have no control over it, exactly as you don't have control over what for example the JVM JIT does. It's the exact same situation, just a level lower.

Re: Scala 3 slowed us down?

#190

Earlier quoted context omitted.

> Especially when the libraries abuse magic language features (and far too many Scala libraries do) Would you mind to explain what you mean?

The library that caused breakage for the OP is a good example: https://github.com/softwaremill/quicklens

I still don't get what you want to say.

Linking some GitHub repo does not explain anything.

What is "abuse", what is "magic" in this context?

Post reply on HN