3 ms·
I am working on an AI book using Swift. Yesterday in a meeting, my manager was asking why Swift. I compared it to Scala, but built on LLVM, and a rich CoreML an
by mark_l_watson 6y ago
I am working on an AI book using Swift. Yesterday in a meeting, my manager was asking why Swift. I compared it to Scala, but built on LLVM, and a rich CoreML and other library infrastructure. REPL + closures, very fast build times.
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.
- agbell 6y agoScala is a great language. I haven't done that coursera course, but many people swear by it. 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.
- zepto 6y agoHaving programmed professionally in both Scala, and Swift, and enjoyed both, I can see basically nothing that Swift takes from Scala. The common ancestor is OCaml, and the ML languages in general. To be fair, that may change as Swift adopts Actor based concurrency.
- asimpletune 6y agoI wish swift were like Scala. It attempts to look and feel like it, but there’s one huge aspect of Scala that is missing in swift that basically makes swift a world apart, which is expressions vs statements. 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.
- ebruchez 6y ago> In swift everything is a statement. There’s a big difference because statements don’t return things, only functions do. That sounds absolutely awful.
- asimpletune 6y agoIt’s such a small, non-flashy language feature, that honestly matters much more than almost everything else.
- yw3410 6y agoComplete aside, but how is Swift these days? I used it literally a week after release and promptly stopped because the compiler kept segfaulting - I imagine it's more stable now?