←back to thread

Scala 3 slowed us down?

(kmaliszewski9.github.io)
261 points kmaliszewski | 3 comments | | HN request time: 0.596s | source
Show context
pjmlp ◴[] No.46183020[source]
The only issue I have with Scala 3 is Python envy, they should not have come up with a second syntax, and pushing it as the future.

If anything is slowly down Scala 3 is that, including the tooling ecosystem that needs to be updated to deal with it.

replies(4): >>46183121 #>>46183318 #>>46184223 #>>46187857 #
gedy ◴[] No.46183121[source]
As a former Scala fan, wow you aren't kidding, wth

    val month = i match
        case 1  => "January"
        case 2  => "February"
        // more months here ...
        case 11 => "November"
        case 12 => "December"
        case _  => "Invalid month"  // the default, catch-all
    
    // used for a side effect:
    i match
        case 1 | 3 | 5 | 7 | 9  => println("odd")
        case 2 | 4 | 6 | 8 | 10 => println("even")
    
    // a function written with 'match':
    def isTrueInPerl(a: Matchable): Boolean = a match
        case false | 0 | "" => false
        case _ => true
replies(3): >>46183181 #>>46183392 #>>46185346 #
1. bdangubic ◴[] No.46183181[source]
madness :)
replies(1): >>46183308 #
2. a24j ◴[] No.46183308[source]
Can you eli5 the madness? And how that relates to python/java?
replies(1): >>46183476 #
3. ◴[] No.46183476[source]