Hacker News new | ask | show | jobs
by pjmlp 1528 days ago
If the plan is to make a native UI for each platform, good approach.

If it is to stay macOS only, also a possible decision not everything needs to be cross platform, why bring Rust into the picture?

3 comments

Why would they not?

Integrating object code into Objective C or Swift is easy, commonplace, people do it all the time.

Rust can generate object code all day, you can insist on the C ABI anywhere you need to, and then you can bring in anything from cargo you want. CocoaPods is... not cargo.

Depends on the purpose, as I mention.

If the target is to be platform specific, then reducing the amount of compiler toolchains, IDE/editor plugins, and language knowledge required across team members is a good thing.

If the purpose is to go cross platform, then it is another matter.

Then again this is a matter of opinion, feel free to disagree, I am not here to change your mind.

Why would support for Rust be a problem here?
Two language development stack, with the complexity it entails, when the product is mac only.
They mentioned elsewhere it started off as a fork of the Xi editor which is written in Rust. Xi separates the text-editor idea into backend and frontend, and Xi itself is primarily the Rust-based backend which concerns itself with making editing operations very fast, and then you can write a front-end client for whatever language/platform you want.

In this case, they can use a fast Rust backend for multiple platforms (or just one) and then use Swift to make a nice, native front-end for MacOS and other native UI languages for other platforms if they wish.

Which is why I made the point on my comment about what the cross platform goals were, but the RIR folks are too quick to jump the gun in any kind of critic and only read half of it.
But you're making the exact opposite mistake, it was already written in Rust, you're asking them to Rewrite in Swift.
Cross platform future aside, they want to use all the good libs Rust has for ropes and the like. The code is based on another editor earlier work, and that's in Rust.

They also know Rust so if they want to use Rust, what's the problem in using it? They don't seem to have any problem with building a UI on top, it's built and looks/works fine.

No problem, hence why I wanted to know why. Maybe I should have read the post better.
Elsewhere in the thread[0], the author claims that Zas Editor started out as a fork of Xi Editor, which was written in Rust.

[0] https://news.ycombinator.com/item?id=30953143