4 ms·
Yes, there's a lot of cross-pollination between Rust and Swift, and Swift devs pragmatically use features from Rust ecosystem. IMO Rust has much better FFI than
by FlyingSnake 6y ago
Yes, there's a lot of cross-pollination between Rust and Swift, and Swift devs pragmatically use features from Rust ecosystem. IMO Rust has much better FFI than Swift, but that's primarily due to Apple. I'm really stoked up for both languages to gain a larger space in developer ecosystem.
> The biggest practical downsides are Apples disregard for other platforms.
This is unfortunately true, but I see Swift committee making serious efforts to overcome that. I hope it gets better with time. Swift on Backend (vapor/Kitura) are simply ages behind Actix.
Another language that's syntactically close is Kotlin/native, even though it has quite different goals. These 3 languages have brought much excitement to development in the past few years.
- zozbot234 6y ago> IMO Rust has much better FFI than Swift, but that's primarily due to Apple. How so? Swift has a stable ABI that, among other things, enables it to expose FFI bindings to many other languages. Rust has made the pragmatic choice of having no stable FFI beyond the C one, so if you want to setup FFI to a Rust library you'll have to write C-compatible wrapping code in Rust and expose that.
- FlyingSnake 6y agoSwift got stable ABI in version 5, that’s bit late IMO. Also the community efforts to improve Rust interop (e.g. Rustler/Elixer) are way ahead when compared to Swift. That being said, I personally am happy that both languages to have first class FFI
- skohan 6y ago> that’s bit late IMO It's pretty rare for a language to have a stable ABI, no? I mean Rust still doesn't have one.
- rvz 6y agoWell for creating bindings, Rust's bindgen falls short. The fact that you need to play around and switch on flags to properly recognise variables, macros and functions over a .h only for generating the FFI layer, it is just harder to maintain, even when updating the library. Swift's ClangImporter does this automatically in the language via clang modules, unlike Rust's bindgen.