I haven’t had much opportunity to use Scala, but I did take Martin’s Functional Programming with Scala course years ago, and that was great.
I haven’t had much opportunity to use Scala, but I did take Martin’s Functional Programming with Scala course years ago, and that was great.
In Scala everything is an expression, meaning everything evaluates to some result even if that result is void.
In swift everything is a statement. There’s a big difference because statements don’t return things, only functions do.
It sounds minor, especially since swift has pattern matching and first class supper for functions etc, but the truth is these are all improvements over a more oop (in the Java sense) way of programming. They don’t however make the languages very similar because at a more basic so level they’re very different.
I would even go as far as to say that rust is more like Scala than swift is, although it’s been a while since I coded in rust.
That sounds absolutely awful.
To me, Swift and Kotlin look like they have taken inspiration from Scala. I think Kotlin explicitly did. That idea transfer from one area to another is how we get better langauges.
The common ancestor is OCaml, and the ML languages in general.
To be fair, that may change as Swift adopts Actor based concurrency.