Live data from Hacker News

Scala 3 Migration: Report from the field

blog.pierre-ricadat.com

31–40 of 124 posts

Re: Scala 3 Migration: Report from the field

#31
post #26

Earlier quoted context omitted.

I don’t use Scala but it will always be better than Python 2/3 because of compile time type checks. If it compiles it should work. In the case of Python 2/3 you could often encounter upgrade issues during runtime !

That can happen in Scala as well because of shared binaries, as is reported in this thread.

It’s a completely different situation compared to Python.

With Scala 2.13/Scala 3 they both compile down to an intermediate format called TASTy which allows binary code to be shared. You don’t get the same binary incompatibilities you do with other languages.

Re: Scala 3 Migration: Report from the field

#32
post #17

I only allow myself to use Scala these days if follow some rules: no sbt (just Maven) and no Scala libraries (just Java ones). I never used fancy stuff like Cats anyways. Curious to hear who actually does, and for what.

I use ZIO (https://zio.dev) and nothing really like it exists on any platform.

You can wrap any computation in a single ZIO object e.g. normal, callback, future, promise etc. Which you can then chain together in different ways e.g. run them in parallel, sequentially, race them against each other and kill the loser, schedule in elaborate ways, run with a timeout and then run another if it’s exceeded etc.

And it will execute this either using normal or virtual threads i.e. fibers without locks so it’s extremely fast.

But the incredible part is that it does all of this whilst seamlessly handling every type of error. Which if you’ve ever written complex concurrent code is extremely hard to get right.

Re: Scala 3 Migration: Report from the field

#33

This is a good report. I started a project last year on Scala 2.13, but had all Scala 3 compatibility features/warnings enabled from the beginning. It sounds like it should be an easy upgrade in the future as long as I don't rely on macros or libraries that rely on macros. I've tried to stick to libraries that already have Scala 3 releases or that come from plain Java.

It doesn't matter if libraries rely on macros because 1) you only depend on their compiled output and 2) you can use Scala 2.13 code from Scala 3. That said, the vast majority of the open source ecosystem has Scala 3 releases by now.

Re: Scala 3 Migration: Report from the field

#34
post #14
post #12

Earlier quoted context omitted.

I don't know, if anything the Scala situation seems much worse than the Python situation. The language looks completely different and there is no easy migration path (not that Python had one, but at least the language was almost the same and you could with some effort write code that worked in both versions). We are in Scala 2.13 and while there are talks about migrating there is no actual plan. Looking at this blog…

Odersky forcing through major syntax changes for Scala 3 was such an unforced error. It's baffling add new syntax on top of major semantic changes to the type system.

Problem is he’s a full time academic.

So he doesn’t care if this amazing feature he’s invented has no IDE support.

Or if the Scala tooling ecosystem is so ridiculously poor.

Re: Scala 3 Migration: Report from the field

#35
post #26

Earlier quoted context omitted.

I don’t use Scala but it will always be better than Python 2/3 because of compile time type checks. If it compiles it should work. In the case of Python 2/3 you could often encounter upgrade issues during runtime !

That can happen in Scala as well because of shared binaries, as is reported in this thread.

That is why I said it “should” work. There are always some really weird edge cases. My broader point holds true. Scala upgrade is not even close to Python 2/3 debacle

Re: Scala 3 Migration: Report from the field

#37
Scala used to be my hobby / enthusiast language. Introduced to it through a college course, and used a bit through school. Later, I would use it for Advent of Code, tinkered with a Scala Play webapp, and dream about using it professionally. Rust has almost completely filled that void now. Rust is native, I'm not waiting on the 1.0 release of `scala-native` anymore. The community around Rust seems to be enthusiastic and growing, as opposed to languishing for Scala. I hold some reservations about Rust in terms of how complicated it is. Despite having used it for an amount of time that I would be feeling comfortable in most languages, I am still not comfortable and continually encounter _stuff I don't understand_.

RIP Scala, I will miss you! You showed me the joy of pattern matching, functional OO, currying, how to use `map` `flatMap` `fold`, etc. All things with continued influence! <3

Re: Scala 3 Migration: Report from the field

#38
post #11
post #7

I left the Scala ecosystems (mostly) a year or 4 ago, right around the release of Scala 3. It's a shame that the compatibility and tooling situation doesn't seem to have improved much since then. The Scala devs always said they wanted to avoid a Python 2->3 situation, but it seemed like they didn't quite achieve that.

I think you should read this report. They made heavy use of many advanced features of Scala 2. Few codebases look like this (and very, very few need to) yet they were able to do it. Moreover, they didn't need to do it. What makes it similar to the Python 2 -> 3 situation is the lack of urgency to migrate, because nobody suffers for not migrating. That's a good thing.

i was surprised to see such advanced type features. i worked at a large scala company. we wouldn’t let most of this stuff through code review. it generally is the kind of magic that saves a tiny amount of code at a high cost of complexity. sounds like this was the authors pet project and wanted to explore instead of write maintainable code

Re: Scala 3 Migration: Report from the field

#39
post #21
post #11

Earlier quoted context omitted.

I think you should read this report. They made heavy use of many advanced features of Scala 2. Few codebases look like this (and very, very few need to) yet they were able to do it. Moreover, they didn't need to do it. What makes it similar to the Python 2 -> 3 situation is the lack of urgency to migrate, because nobody suffers for not migrating. That's a good thing.

Most people used advanced features, even if they were hidden behind libraries. Even if you’ve just had a codebase which only used playframework.

It definitely took a while for most libraries to catch-up with Scala 3, now, I don't see anything is missing in the main area I work with (web development), playframework already works for Scala 3.

Re: Scala 3 Migration: Report from the field

#40
post #17

I only allow myself to use Scala these days if follow some rules: no sbt (just Maven) and no Scala libraries (just Java ones). I never used fancy stuff like Cats anyways. Curious to hear who actually does, and for what.

sbt is way better than what it used to be, also, check-out scala-cli which is very nice.
Post reply on HN