News for hackers. Stuff that matters.
Re:Scala 3.0 by augustk on Friday May 14, 2021 @09:10AM (#27153856)
I think the best evolution of a programming language is when some features are removed and replaced by a unifying concept which makes the language both smaller and and more expressive. Has that happened in Scala 3?
Re:Scala 3.0 by agbell on Friday May 14, 2021 @10:40AM (#27154807)
In some areas it is explicitly the opposite that happened, and in a way that is for the best — see implicits.

Scala 2 is a very flexible language and a lot of outsider complaints seem grounded in this flexibility.

Scala 3 is more opinionated in some ways:

"Opinionated: Contextual Abstractions

One underlying core concept of Scala was (and still is to some degree) to provide users with a small set of powerful features that can be combined to great (and sometimes even unforeseen) expressivity. For example, the feature of implicits has been used to model contextual abstraction, to express type-level computation, model type-classes, perform implicit coercions, encode extension methods, and many more. Learning from these use cases, Scala 3 takes a slightly different approach and focuses on intent rather than mechanism. Instead of offering one very powerful feature, Scala 3 offers multiple tailored language features, allowing programmers to directly express their intent

"

I think it is a very practical and grounded focus change.

https://docs.scala-lang.org/scala3/new-in-scala3.html

Re:Scala 3.0 by mnd999 on Friday May 14, 2021 @12:50PM (#27156459)
It’s a shame it’s got less opinionated in other ways. Scala developers must be really looking forward to the endless debates over curly brackets vs white space.
Re:Scala 3.0 by neysofu on Friday May 14, 2021 @01:24PM (#27157004)
I still can't believe they went for that. I wouldn't really care if the team wanted to switch to significant indentation, but it's absurd to provide two altogether different syntaxes just for the sake of it.
Re:Scala 3.0 by hocuspocus on Friday May 14, 2021 @03:22PM (#27158618)
It isn't for the sake of it, breaking source compatibility would have been a major annoyance.
Re:Scala 3.0 by peq on Friday May 14, 2021 @02:04PM (#27157583)
I don't think i will be much of a problem. Braces are already optional in Scala2 if you only use a single expression. The change just gives you the option to be more consistent and remove braces everywhere.
Re:Scala 3.0 by kjaer on Friday May 14, 2021 @09:38AM (#27154151)
Re:Scala 3.0 by dtech on Friday May 14, 2021 @12:25PM (#27156065)
Scala 3 isn't such a language, most of the stuff people use is still there.

The biggest change touching your comment is replacing one feature (implicits) with a couple more tailored features (extension methods, conversions and context parameters). In practice they were very powerful and versatile, but also complicated, finicky and bug-prone. Feels a bit like pointers in that regard.

Re:Scala 3.0 by valenterry on Friday May 14, 2021 @10:06AM (#27154476)
I totally agree with that sentiment. Not only about evolution but in general. A good programming language trues to use unifying concepts as much as possible.

Fortunately, Scala is one of the best (statically typed) languages in that regard that I ever used.