Live data from Hacker News

Scala 3.0.0-M1

github.com

21–30 of 148 posts

Re: Scala 3.0.0-M1

#21
post #4

I've always loved Scala and Scala 3 is shaping up to be extremely exciting. Love the new ADTs and braceless syntax: really gives the language a cleaner and more ML inspired feel. No other conventional language (including OCaml, F#, etc) seem to have the effortless kind of power Scala does. The combination of the extremely powerful type system with the "OOFP" paradigm is a great combination. OOFP is such a great parad…

I am skeptical about the novelty of Scala's "OOFP" as you put it. It looks essentially the same as the original anonymous classes or SAM types in Java. Function values are objects with a single method and methods themselves are not first-class, but are wrapped in objects as required. The most important part of OO are the first-class modules; and in the literature, arguably more elegant examples of unifying first-class modules and FP exist, for example by starting with FP and adding objects as records containing functions, this way both "objects" and methods would be first-class. Subtyping also adds significant complexity to the language and weakens type inference.

Scala is, first and foremost an OO language which embraces subtyping, class hierarchies and imperative programming, see for example its own collections library. As Java gets more and more FP features, there is a danger it will struggle to differentiate itself.

Re: Scala 3.0.0-M1

#22
post #7
post #4

I've always loved Scala and Scala 3 is shaping up to be extremely exciting. Love the new ADTs and braceless syntax: really gives the language a cleaner and more ML inspired feel. No other conventional language (including OCaml, F#, etc) seem to have the effortless kind of power Scala does. The combination of the extremely powerful type system with the "OOFP" paradigm is a great combination. OOFP is such a great parad…

For me scala's feature set is absurdly big and there are always 10 ways todo things. Look at the spec of Scala. Its 200 pages long. That's insane. I'd rather use Kotlin.

IIRC one of Odersky's stated goal for Scala 3 was to address exactly this issue. That being said, it is developed in a research setting so I guess even if they restrict these features now, there will be new ones added over time...

Re: Scala 3.0.0-M1

#23
post #8
post #2

Scala 3 is a huge change. As someone who used Scala for years, but always wondered whether they can retain their users with competition from Kotlin, I'm extremely curious what this will mean for Scala in the long run. I'm skeptical, because the cost to migrate is big. But I'm hopeful, because Scala is a language I like to write code in. Edit: why am I skeptical? I know scala 3 is largely meant to be backwards compati…

On the JVM, I think Scala won't have any major issues it is just another guest language and isn't used to sell InteliJ licenses. Kotlin is chaining itself to Android, it will rule there thanks to Google's sponsorship, on everything else it is just yet another language to chose from with a weaker eco-system, used to sell InteliJ licenses.

Kotlin has significant support from the largest Java ecosystem: Spring. In my experience it's also much more compatible with Java/JVM libraries. In Scala that's perfectly possible but leads to very un-idiomatic code, in Kotlin you barely notice.

Re: Scala 3.0.0-M1

#24

Just want to give Martin Odersky a shout out - what a legend this guy. 62 years old, going strong. I'm not even in the java ecosystem but Scala strikes me as the most likely language to do something fresh and interesting on top of an existing ecosystem in the next few years, which is terrific news.

There are many reasons why I respect him, but the fact that he laid out a time plan for Scala 3 already 2 years ago and then kept the timeline is mind-boggling.

Re: Scala 3.0.0-M1

#25
post #2

Scala 3 is a huge change. As someone who used Scala for years, but always wondered whether they can retain their users with competition from Kotlin, I'm extremely curious what this will mean for Scala in the long run. I'm skeptical, because the cost to migrate is big. But I'm hopeful, because Scala is a language I like to write code in. Edit: why am I skeptical? I know scala 3 is largely meant to be backwards compati…

The crucial point here is if Scala 3 maintains backwards compatibility with Scala 2.x. If not, it's effectively a new language and then the game becomes which of the existing scala code bases will switch over and when. There's a large amount of existing Scala code out there and embarking on a migration of that stuff is going to take very long. We're talking many years here potentially. The few Scala projects I've dea…

> The crucial point here is if Scala 3 maintains backwards compatibility with Scala 2.x.

The Scala team is keenly aware. Scala 3 can use Scala 2.13 libraries - in fact the 3.0 stdlib is the exact same .jar as the 2.13 stdlib - and a future version of 2.13 will be able to use scala 3 artifacts as long as it doesn't use 3+ only language features.

More details at https://scalacenter.github.io/scala-3-migration-guide/docs/c...

Re: Scala 3.0.0-M1

#26
post #8
post #2

Scala 3 is a huge change. As someone who used Scala for years, but always wondered whether they can retain their users with competition from Kotlin, I'm extremely curious what this will mean for Scala in the long run. I'm skeptical, because the cost to migrate is big. But I'm hopeful, because Scala is a language I like to write code in. Edit: why am I skeptical? I know scala 3 is largely meant to be backwards compati…

On the JVM, I think Scala won't have any major issues it is just another guest language and isn't used to sell InteliJ licenses. Kotlin is chaining itself to Android, it will rule there thanks to Google's sponsorship, on everything else it is just yet another language to chose from with a weaker eco-system, used to sell InteliJ licenses.

> used to sell InteliJ licenses

Though IntelliJ has amazing features for Java/Kotlin: it comes with a free version that packs most of 'm. I think saying it's all to sell licenses is a disingenious, lots of longstanding Java pain points get addressed by Kotlin in a really nice way. It has a really strong webdev ecosys building up, and comes with a rather interesting feature set as language itself. I'd say its good "typed Ruby" (OO at the core, FP where it makes sense, very expressive, dont type too much).

Scala's issues on the other hand stem, I think, from it being multi-paradigm. Where Kotlin is OO-core with FP where it makes sense, Scala is both OO and FP at the same time which makes it messy.

Frege explored being full FP on the JVM, but looking at the repo[0] it did not get much traction.

[0]: https://github.com/Frege/frege

Re: Scala 3.0.0-M1

#27
post #7
post #4

I've always loved Scala and Scala 3 is shaping up to be extremely exciting. Love the new ADTs and braceless syntax: really gives the language a cleaner and more ML inspired feel. No other conventional language (including OCaml, F#, etc) seem to have the effortless kind of power Scala does. The combination of the extremely powerful type system with the "OOFP" paradigm is a great combination. OOFP is such a great parad…

For me scala's feature set is absurdly big and there are always 10 ways todo things. Look at the spec of Scala. Its 200 pages long. That's insane. I'd rather use Kotlin.

This is like saying, airplanes are too complex. There are so many knobs and buttons. I'd rather just walk or ride a bike everywhere.

Scala is a very powerful, very expressive language. There are some features which you can just choose to leave out. If you do, you end up with a very clean, concise, and powerful language that makes you really productive.

I've literally had moments where I made my algorithm 5x faster just by adding 4 letters: '.par' in front of an operation. Instantly it got parallelized without my having to do anything, and the processing time got cut 5x.

Re: Scala 3.0.0-M1

#28
post #23
post #8

Earlier quoted context omitted.

On the JVM, I think Scala won't have any major issues it is just another guest language and isn't used to sell InteliJ licenses. Kotlin is chaining itself to Android, it will rule there thanks to Google's sponsorship, on everything else it is just yet another language to chose from with a weaker eco-system, used to sell InteliJ licenses.

Kotlin has significant support from the largest Java ecosystem: Spring. In my experience it's also much more compatible with Java/JVM libraries. In Scala that's perfectly possible but leads to very un-idiomatic code, in Kotlin you barely notice.

Scala has an issue with the concept of "idiomatic code". I'd say when it comes to "idiomatic code", Go and Scala are at the opposite sides of the spectrum.

Re: Scala 3.0.0-M1

#29
post #2

Scala 3 is a huge change. As someone who used Scala for years, but always wondered whether they can retain their users with competition from Kotlin, I'm extremely curious what this will mean for Scala in the long run. I'm skeptical, because the cost to migrate is big. But I'm hopeful, because Scala is a language I like to write code in. Edit: why am I skeptical? I know scala 3 is largely meant to be backwards compati…

I have a pretty large codebase written in scala 2.12 or so (whatever the version was around late 2018). I'd like to migrate it to scala 3. Any ideas how hard it'll be?

Re: Scala 3.0.0-M1

#30
post #7

Earlier quoted context omitted.

For me scala's feature set is absurdly big and there are always 10 ways todo things. Look at the spec of Scala. Its 200 pages long. That's insane. I'd rather use Kotlin.

> For me scala's feature set is absurdly big and there are always 10 ways todo things. One of my favourite examples: of these 13 different ways of doing the same thing, only 12 are correct. https://nurkiewicz.github.io/talks/2014/scalar/#/22

I'd say that holds about as much value as criticizing C-style languages for allowing all these variants

    if(x) true
    if(x)
      true
    if(x) (true)
    if(x) {true}
    if(x) {
      true
    }
    if(x)
    {
      true
    }
etc. In practice you use a linter to enforce a style and it's not a problem.

For the curious. The combinations follow out of fairly simple rules:

    () and {} are interchangeable for expressions - altough {} can contain multiple statements and () only an expression.
    x op y is equivalent to x.op(y)
    Type abscriptions - x : Type - are optional and will be inferred if possible
    { case ... } is the pattern match construct and works similarly to a function with 1 parameter.
Post reply on HN