I'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
If 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.
I'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.
Will keep an eye out on your GitHub, just saw the repo you already have there. This is a heroic effort!
If you're interested, you can kinda see what I've been trending towards here: https://twitter.com/ryanmcgrath/status/1238285152771440640
The goal is to feel very, very familiar to anyone who's done Cocoa work before. :)
Re:Yes, I am still learning Rust
by steveklabnik on Thursday March 12, 2020 @05:39PM
(#22562070)
My employer, Cloudflare, is using Rust as part of the 1.1.1.1 app on iOS.
Is this code shared across platforms?
Re:Yes, I am still learning Rust
by steveklabnik on Thursday March 12, 2020 @07:24PM
(#22563115)
Yes, it's also used on Android, mobile-wise, and tons of desktop platforms: https://github.com/cloudflare/boringtun#supported-platforms
Re:Yes, I am still learning Rust
by ElderKorihor on Thursday March 12, 2020 @05:22PM
(#22561901)
I love Rust, but it doesn't have a strong UI development story yet.
Re:Yes, I am still learning Rust
by gameswithgo on Thursday March 12, 2020 @06:14PM
(#22562472)
very few languages do, and those that do it is usually for just one platform.
Re:Yes, I am still learning Rust
by Polylactic_acid on Thursday March 12, 2020 @06:40PM
(#22562708)
Because 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.
Because most UI toolkits are strongly object oriented and Rust isn't an object oriented language.
FullStory 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.
It'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).
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?