Live data from Hacker News

Show HN: I rewrote my Mac Electron app in Rust

desktopdocs.com

11–20 of 465 posts

Re: Show HN: I rewrote my Mac Electron app in Rust

#11

Given your destination was the Mac app, why not Swift/SwiftUI rather than Rust/Tauri? Just curious is all.

I wanted to ask the same question. Swift is a fairly nice language and seems to offer many of the benefits of Rust. As another commentator asked, I am also interested in details of integrating CLIPs. I like the narrative, BTW, on why you needed to port your app.

Thanks! Mentioned it on the other comment - but we're using the Ort crate in rust and bunlding onnxruntime with the app. Definitely considered Swift and I know it's gotten a lot better since I last used it, but cross-platform support was what got us to use Rust over Swift.

As far as porting over goes, we are much happier maintaining the new version.

Re: Show HN: I rewrote my Mac Electron app in Rust

#12

Given your destination was the Mac app, why not Swift/SwiftUI rather than Rust/Tauri? Just curious is all.

Curious as well. I’m planning to build a desktop app, haven’t use swift for a long time and I’m pretty new to rust. Tauri looks very promising. I really don’t like electron apps. They’re so slow to start even on lightning fast machines. Thanks for any insights!

Re: Show HN: I rewrote my Mac Electron app in Rust

#14
I recently went the other way (started a project in Tauri, moved to Electron) because of frustration with rendering differences between the web views employed on different platforms. Have you run into any cross platform UI bugs since you switched?

It looks like your UI needs are pretty simple while computation is complex so the extra QA tradeoff would still be worth it for you. I'm just wondering if my experience was unusual or if rendering differences are as common as they felt to me.

Also, did you go Tauri 2.0 or 1.0? 2.0 released its first stable release while I was mid-stream on v1, and migration was a nightmare/documentation was woefully inadequate. Did they get the docs sorted out?

Re: Show HN: I rewrote my Mac Electron app in Rust

#15
post #3

How do you run CLIP in Rust? I'm still not sure what the best inference stack on Rust is --- I tried onnxruntime bindings in Rust a few years ago and it was rather finicky to work with.

We're using the onnxruntime bindgs with the Ort crate. Our biggest challenge was just bundling the onnxruntime into the app and making sure everything was signed, etc.

Tauri, from my experience, can be extremely frustrating.

Re: Show HN: I rewrote my Mac Electron app in Rust

#16

There is no trial - the "Try Desktop Docs" button just links you to a stripe payment. Also it's a bit ambiguous if it searches documents? All the screenshots of are of image search, but the features say you can search inside PDFs and docs, though "All Your Files" says images and videos only-

We aren't offering a trial right now, but to answer about docs --> we're testing an update to support searching text and will be releasing it soon. Right now you can search the contents of all your images and videos.

Re: Show HN: I rewrote my Mac Electron app in Rust

#17
post #3

How do you run CLIP in Rust? I'm still not sure what the best inference stack on Rust is --- I tried onnxruntime bindings in Rust a few years ago and it was rather finicky to work with.

> I'm still not sure what the best inference stack on Rust is

I was just looking into this today!

The options I've found, but yet to evaluate:

- TorchScript + tch = Use `torch.jit.trace` to create a traced model, load with tch/rust-tokenizers

- rust-bert + tch = Seems to provide slightly higher-level usage, also use traced model

- ONNX Runtime - Convert (via transformers.onnx) .pt model to .onnx encoder and decoder, then use onnxruntime+ndarray for inference

- Candle crate - Seems to have the smallest API for basic inference, and AFAIK can load up models saved with model.save() without conversion or other things

These are the different approaches I've found so far, but probably missed a bunch. All of them seem OK, but on different abstraction-levels obviously, so depends on what you want ultimately. If anyone know any other approach, would be more than happy to hear about it!

Re: Show HN: I rewrote my Mac Electron app in Rust

#18
post #15

Earlier quoted context omitted.

We're using the onnxruntime bindgs with the Ort crate. Our biggest challenge was just bundling the onnxruntime into the app and making sure everything was signed, etc.

Tauri, from my experience, can be extremely frustrating.

Yeah there are definitely hang ups along the way. It's a big of wack-a-model but thankfully we've had an easier time developing with Rust than on Electron.

Re: Show HN: I rewrote my Mac Electron app in Rust

#19
post #3

How do you run CLIP in Rust? I'm still not sure what the best inference stack on Rust is --- I tried onnxruntime bindings in Rust a few years ago and it was rather finicky to work with.

We're using the onnxruntime bindgs with the Ort crate. Our biggest challenge was just bundling the onnxruntime into the app and making sure everything was signed, etc.

I heard about burn [1] and candle [2] recently and they sounded interesting.

[1] https://crates.io/crates/burn

[2] https://github.com/huggingface/candle

Interestingly, burn supports candle as a backend.

Re: Show HN: I rewrote my Mac Electron app in Rust

#20
post #14

I recently went the other way (started a project in Tauri, moved to Electron) because of frustration with rendering differences between the web views employed on different platforms. Have you run into any cross platform UI bugs since you switched? It looks like your UI needs are pretty simple while computation is complex so the extra QA tradeoff would still be worth it for you. I'm just wondering if my experience was…

[deleted]
Post reply on HN