Live data from Hacker News

Scala 3.0

github.com

291–292 of 292 posts

Re: Scala 3.0

#291
post #98

Earlier quoted context omitted.

TS is great but lack of pattern matching cripples the language somewhat

It helps that is has good smart-casting, you can do with an if where other languages need pattern matching const x: { t: 'A', foo: string } | { t: 'B', bar: string } = /*...*/ return x.t === 'A' ? x.foo : x.bar

It is cool syntax trick, but it won’t make compiler tell you when you missed a case

Re: Scala 3.0

#292
post #103

Earlier quoted context omitted.

I totally agree. I love the direction of Scala 3. This quote says it all I think: "Scala 3 takes a slightly different approach [from Scala 2] 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" So rather than something like implicits, that can be used N different ways, onl…

I always felt like implicits were a weaker design in the language, glad to see they put some more thought behind it.

It was a brilliant concept, but the ergonomics weren't great. It was like working with the lambda calculus. Sure, you can literally model anything, but it's not intuitive to most people.
Post reply on HN