3 ms·
Swift is different from Rust, but it's more towards Rust's end of the spectrum. Sure, it has classes, but it's almost as if they're mostly there to aid in compa
by pohl 4y ago
Swift is different from Rust, but it's more towards Rust's end of the spectrum. Sure, it has classes, but it's almost as if they're mostly there to aid in compatibility with Objective-C APIs like UIKit. SwiftUI builds UIs with value types and protocols like View.
I wonder if something like SwiftUI would work well for Rust.
- raphlinus 4y agoI think the answer is yes. See rui in particular (linked by its author in another comment), which inspired my Xilem exploration.
- pjmlp 4y agoVisual designers and GUI components don't play well with borrow checker.
- pornel 4y agoSwift<>Rust similarity is only superficial in syntax. Swift has full OOP with inheritance, allows shared mutable state, and doesn't have compile-time thread safety. It has been built for Cocoa interoperability from the start. The clunky `Rc<RefCell<Object>>` that Rust tries to get rid of from UI toolkits in Swift is just `Object`. Rust's undesirable case is the Swift's built-in default (that's not a criticism of Swift, ARC works great there, but these two languages have chosen very different trade-offs).
- pjmlp 4y agoIt has partial support for it, and Swift 6.0 roadmap has a plan for it. https://www.infoq.com/news/2020/01/swift-6-vision/ https://www.infoq.com/news/2020/01/swift-6-vision/ Additionally its async/await and distributed actors story is much better than Rust's current story.
- pohl 4y agoSwift is kind of like the two-headed best Orthrus from greek mythology, but where classes & OOP are confined to one head. You only really need to deal with them when you're interacting with legacy APIs. All of the new APIs use value semantics.
- pohl 4y agos/best/beast/
- worik 4y agoWhat about Flutter?