Live data from Hacker News

macOS Apps in Rust

github.com

51–60 of 89 posts

Re: macOS Apps in Rust

#52
post #37

Earlier quoted context omitted.

Nope, someone has to manually type .clone() calls.

That's irrelevant (and barely different to having to type `=`). The salient point is that you don't need to manually call free/release.

That is more than relevant, otherwise we are comparing oranges to apples, pun intended.

Automatic Reference Counting.

Since = is the same as .clone() in character count?

Re: macOS Apps in Rust

#53
post #14

Earlier quoted context omitted.

> Something that isn't talked about much in the GUI world (outside of mobile development) is how essential multi-threading is to a great application experience. Yes it is. Heavyweight desktop GUI applications like DAWs or CAD or image/video editing are old established technology. > This has the advantage of a project feeling natural to the platform while still allowing for code reuse between platforms Having written…

> Rust isn't some silver bullet Rust codebases extend in size and scale to larger teams fundamentally better than C++ / C. Rust offers more leverage in building ambitious system software. Since you mention Qt, imagine writing all of Qt in x86 assembly, vs. C++. "There's not particular reason this isn't doable." C++ to Rust is a similar jump. No silver bullets; just leverage. Cross-platform toolkits — especially those…

> Rust codebases extend in size and scale to larger teams fundamentally better than C++ / C

There are about 3-4 orders of magnitude more large C++ projects developed by large teams compared to Rust projects as of now.

This might change in future, but your claim seems a bit premature.

In a previous company I worked at, we were forced to rewrite a greenfield project in C++ because it was going too slow with Rust. The team managed to ship the thing in a few months, compared to spending a month getting nowhere with Rust.

Re: macOS Apps in Rust

#54
post #8

Earlier quoted context omitted.

More tangential, is there a good, in-depth resource for learning how to build an app in AppKit w/ Swift?

Unfortunately I can't point you at a single comprehensive resource. Instruction for building apps in AppKit has always been kind of spotty. When I first started learning it alongside Objective-C in the 2000s, the best a beginner could really do was sift through random blogposts and mimic patterns seen in FOSS Mac apps. The best resources at that point were probably the various books on the topic (such as the Big Nerd…

Gotcha, thanks for the reply. I think you'd have the market on this domain cornered if ever you'd produced a comprehensive text since its very much still blog posts and reading extant code.

Re: macOS Apps in Rust

#55
post #14

Earlier quoted context omitted.

> Something that isn't talked about much in the GUI world (outside of mobile development) is how essential multi-threading is to a great application experience. Yes it is. Heavyweight desktop GUI applications like DAWs or CAD or image/video editing are old established technology. > This has the advantage of a project feeling natural to the platform while still allowing for code reuse between platforms Having written…

> Rust isn't some silver bullet Rust codebases extend in size and scale to larger teams fundamentally better than C++ / C. Rust offers more leverage in building ambitious system software. Since you mention Qt, imagine writing all of Qt in x86 assembly, vs. C++. "There's not particular reason this isn't doable." C++ to Rust is a similar jump. No silver bullets; just leverage. Cross-platform toolkits — especially those…

> Qt was about the best we could do in the C++ era, but a new era has dawned.

Based on the way the Rust community has been spinning its wheels for years in getting something even within a light year of feature parity with Qt, if a new era has truly dawned you might need to wait for the next one.

> Rust codebases extend in size and scale to larger teams fundamentally better than C++ / C. Rust offers more leverage in building ambitious system software.

I like Rust - but this is classic RSF/RIIR copypasta.

Re: macOS Apps in Rust

#57
post #30

Earlier quoted context omitted.

> Can you give an example of something can only be done in a native app? Accessibility, text field behaviors, control animations looking right, window resizing behaviors, any system settings related to UI applying properly, printing, export to PDF, rich text copy and paste, normal power and memory use, the engineers working on the next OS release being able to fix your app if they break it, your app updating to the n…

afaik not a problem with apps written in something like react native which use platform specific widgets and common business logic.

It actually is. Fortunately, the quality of apps dropped significantly, allowing these technologies to compete.

Re: macOS Apps in Rust

#58
post #51

Earlier quoted context omitted.

If you don't, the compiler tells you to, as per standard Rust semantics.

Automatic Reference Counting. Writing by hand isn't the same.

Except that even Apple's ARC is not automatic - try passing the pointer to a GArray, or putting it on a malloc'ed linked list or any other data structure not implemented in Swift or ObjectiveC (provided that you compile objectiveC with the correct build flags).

The point is: you can't leak, you can't end up keeping a reference without incrementing the refcount and you don't events have to worry about any of the refcounting as long as the code you write is sound according to Rust rules.

Re: macOS Apps in Rust

#59

Interesting to see that AppKit is fully supported before UIKit, usually it's the reverse (if AppKit is supported at all). I suppose it kind of makes sense… the case for sharing a Rust core across platforms is stronger on macOS, because on iOS the optimizations you're trading away (such as the native network stack scheduling requests from apps to fire while the antenna is already awake) have a bigger impact on iDevice…

Author here. :)

AppKit is first because this was extracted from a cross platform GUI library I was building years ago, and it’s just less cumbersome to iterate on.

Re: macOS Apps in Rust

#60

> I would be surprised if we didn't have another ~5+ years of support Five years would shock me. I’d say more like ten. It’s gonna take a huge concerted effort to get rid of objc in macos, and idk if it’s worth it

FWIW, I’m the author and I think I wrote that line close to 5 years ago already… so you may be right. :)
Post reply on HN