2 ms·
Swift<>Rust similarity is only superficial in syntax. Swift has full OOP with inheritance, allows shared mutable state, and doesn't have compile-time thread saf
by pornel 4y ago
Swift<>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/