5 ms·
1.0 was released 5 years ago. Swift is younger and I think it’s a great language. If the tooling is ready and I don’t have to fight it, I’d be fine using Rust
by melling 7y ago
1.0 was released 5 years ago.
Swift is younger and I think it’s a great language.
If the tooling is ready and I don’t have to fight it, I’d be fine using Rust. I just need a reason. Anyone using it for iOS development?
- ElderKorihor 7y agoI love Rust, but it doesn't have a strong UI development story yet.
- gameswithgo 7y agovery few languages do, and those that do it is usually for just one platform.
- Polylactic_acid 7y agoBecause native UI is on the decline unfortunately. Its too complicated and there are too many different systems. If you want a gui in rust you would be better off having your program start a web server on localhost.
- mlindner 7y agoBecause most UI toolkits are strongly object oriented and Rust isn't an object oriented language.
- steveklabnik 7y agoMy employer, Cloudflare, is using Rust as part of the 1.1.1.1 app on iOS.
- saagarjha 7y agoIs this code shared across platforms?
- steveklabnik 7y agoYes, it's also used on Android, mobile-wise, and tons of desktop platforms: https://github.com/cloudflare/boringtun#supported-platforms https://github.com/cloudflare/boringtun#supported-platforms
- Klonoar 7y agoI've actually got a working set of bindings to AppKit/UIKit that I'm trying to get to a release-able point. They run fine on both macOS and iOS; for the former I've also got decent support for sandboxed environments. My goal is to write all my stuff in Rust, because I am sick and tired of writing products for the Apple ecosystem and then having to rewrite them if I want them outside of it. I don't enjoy writing browser-wrapped applications (though they have their place, let me be clear...). I don't want to write in C just to be able to compile anywhere. IMO, Rust is the future. /end fanboy-ism I suppose
- weiming 7y agoIf you can share, how usable is your approach boilerplate/types wise? Would love to go all into Rust but the AppKit/etc. bindings get clunky very easily.
- Klonoar 7y agoI've actually settled on an approach that feels just like writing Cocoa/AppKit/UIKit. It effectively exposes wrapper types that loop in delegates, so you wind up with a feeling like you're writing classes - you just can't subclass. I've tried to keep the conventions (entry points, lifecycles, method naming) very similar so knowledge transfer is there. I have a repo for it but the example is pretty out of date. Can see about updating it when I've got the next push ready.
- weiming 7y agoWill keep an eye out on your GitHub, just saw the repo you already have there. This is a heroic effort!
- Klonoar 7y agoIf you're interested, you can kinda see what I've been trending towards here: https://twitter.com/ryanmcgrath/status/1238285152771440640 https://twitter.com/ryanmcgrath/status/1238285152771440640 The goal is to feel very, very familiar to anyone who's done Cocoa work before. :)
- weiming 7y agoIt's very easy to cross-compile and use Rust as a library, leaving the Swift portion for display/views only. We are looking at doing this for our next app (OS X, but would work just as fine for iOS).
- Joof 7y agoThat long? I remember the launch parties...
- nfriedly 7y agoFullStory is - we have a shared core codebase in Rust, and then some OS-specific code for Android and iOS. We're using a custom Rust toolchain so that we can support bitcode on iOS, but if you don't need that feature, then stable Rust works fine.