2 ms·
Welp, if we're gonna do the same tired arguments (Electron, etc), I guess I'll go ahead and inject another HN-meme into this thread. Let's talk about Rust. I,
by Klonoar 7y ago
Welp, if we're gonna do the same tired arguments (Electron, etc), I guess I'll go ahead and inject another HN-meme into this thread. Let's talk about Rust.
I, like many, want to write the same code across platforms. I do not want to use the JS toolchain (the modern one, Webpack & co). I don't want to use C, because writing C feels contrarian outside of certain cases given the options available today. I want something that's fast, safe and mostly cross-platform.
So I started porting AppKit to Rust. There's an example you can see here - it's meant to feel similar to writing native UI in Swift.
https://twitter.com/ryanmcgrath/status/1238285152771440640 https://twitter.com/ryanmcgrath/status/1238285152771440640
I plan to put this in a longer blog post, but effectively I don't think write-once-run-anywhere UI works for the class of products I want to build. I don't mind rebuilding the app UI using GTK, AppKit, or what have you... provided I'm not running some ridiculous setup just to get code shared across platforms. Rust and Cargo do incredibly well with this.
I'm building my next product in this as a way to dogofood and force the functionality in. If you're interested in following along, you can check out the repo below - note that it's still experimental, the example app (Subatomic) has not been updated for recent changes yet, and the main repo doesn't have docs being built just yet (though I'll probably have this later this week).
Anyway, that's my bit - wondering if there's a better way to achieve cross platform code without the headache, so consider this another foray into getting there.
https://github.com/ryanmcgrath/appkit-rs https://github.com/ryanmcgrath/appkit-rs