3 ms·
How Swift Achieved Dynamic Linking Where Rust Couldn't: https://faultlore.com/blah/swift-abi/ https://faultlore.com/blah/swift-abi/ Many programming languages
by hazn 4y ago
How 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.
- kaba0 4y agoThank you, I can agree with the first few. But I feel neither did Swift get SwiftUI right, it is hacked on top of the language and would not be reimplementable strictly as a library.