4 ms·
> The PL theory community seems to appreciate its innovations I'm curious as to what these innovations are. I've not looked too deeply into Swift - I've played
by d3nj4l 4y ago
> The PL theory community seems to appreciate its innovations
I'm curious as to what these innovations are. I've not looked too deeply into Swift - I've played around with SwiftUI a bit and nothing else - but from what I saw I didn't see any fundamentally novel ways to do things. People talk about protocols/actors etc, but I've seen other languages that do those and (IMO) better. If anything, I thought the emphasis on creating new forms of syntax for things that should've been built as more fundamental, orthogonal concepts (eg. `guard let` etc.) would've made it more distasteful to the PL theory crowd, who love orthogonality IME.
(I'm sorry if I'm coming off as sarcastic/combative, I'm genuinely curious about this!)
- favorited 4y agoThe Swift story around ABI stability and library evolution is pretty unique. Relatedly, its approach to generics doesn't fall into either of the 2 traditional paths (either box everything like Java and C#, or template instantiation like C++ or Rust). https://faultlore.com/blah/swift-abi/ https://faultlore.com/blah/swift-abi/ https://www.youtube.com/watch?v=ctS8FzqcRug https://www.youtube.com/watch?v=ctS8FzqcRug
- cwzwarich 4y agoThe closest thing to Swift’s approach to polymorphism in the academic world is intensional polymorphism: https://www.cs.cmu.edu/~rwh/papers/intensional/popl95.pdf https://www.cs.cmu.edu/~rwh/papers/intensional/popl95.pdf
- hazn 4y agoHow Swift Achieved Dynamic Linking Where Rust Couldn't: https://faultlore.com/blah/swift-abi/ https://faultlore.com/blah/swift-abi/ Many programming languages list Swift as inspiration: https://www.val-lang.dev/ https://www.val-lang.dev/ Rust's optional bindings are inspired by swift: https://doc.rust-lang.org/reference/influences.html https://doc.rust-lang.org/reference/influences.html (Many people who worked on Rust also worked on Swift, like the creator of rust) The SwiftUI framework you mentioned uses inspiring syntax, which has been tried do be emulated (Jetpack Compose, Druid). However, nobody got it as magical as Swift did. The way SwiftUI Syntax combines pl theory and developer usability is amazing.
- d3nj4l 4y agoThank you! The point on ABI compat is interesting - I guess that's the sort of thing that makes Swift truly an "end to end" language. Though at the same time, the focus on dynamic linking is a source of one common complaint with swift, IIRC - people often complain that the language features they use are tied to OS versions. > which has been tried do be emulated (Jetpack Compose, Druid). However, nobody got it as magical as Swift did. That's interesting, too. I'm not a UI programmer by any means, and from what little I tried of SwiftUI and JP Compose (though I have written more server-side Kotlin and found it perfectly pleasant) I didn't see a significant difference. Do you have any further reading I can look into this further?
- pjmlp 4y agoVal is being designed by former Swift devs, no wonder. Dynamic linking in AOT compiled languages exists for decades, other priorities in other ecosystems. Groovy DSL for Swing was one of the first languages with such approach. However all in all, it is a great language for the Apple ecosystem.
- ladberg 4y agoI’d take a look at the Swift ABI article linked, it explains incredibly well how Swift handles it better than pretty much any other language I’ve seen. There are a lot more aspects to dynamic linking than a binary possible / not possible.
- pjmlp 4y agoI know the Swift ABI, and I also have seen enough compiled languages with defined ABIs, since I started coding in 1986, and majored in systems programming and language design.
- FlyingSnake 4y ago>nobody got it as magical as Swift did. I was with you till this line. SwiftUI was so half baked for several versions that it took them 3 years to get a respectable navigation API. SwiftUI is great but it still has rough edges.