Live data from Hacker News

Show HN: I rewrote my Mac Electron app in Rust

desktopdocs.com

1–10 of 465 posts

Show HN: I rewrote my Mac Electron app in Rust

#1
A year ago, my co-founder launched Desktop Docs here on HN. It's a Mac app we built with Electron that uses CLIP embeddings to search photos and videos locally with natural language. We got positive feedback from HN and our first paying customers, but the app was almost 1GB and clunky to use.

TLDR; rebuilding in Rust was the right move.

So we rewrote the app with Rust and Tauri and here are the results:

- App size is 83% smaller: 1GB → 172MB - DMG Installer is 70% smaller: 232MB → 69.5MB - Indexing files is faster: A 38-minute video now indexes in ~3 minutes instead of 10-14 minutes - Overall more stability (old app used to randomly crash)

The original version worked, but it didn't perform well when you tried indexing thousands of images or large videos. We lost a lot of time struggling to optimize Electron’s main-renderer process communication and ended up with a complex worker system to process large batches of media files.

For months we wrestled with indecision about continuing to optimize the Electron app vs. starting a full rebuild in Swift or Rust. The main thing holding us back was that we hadn’t coded in Swift in almost 10 years and we didn’t know Rust very well.

What finally broke us was when users complained the app crashed their video calls just running in background. I guess that’s what happens when you ship an app with Chromium that takes up 200mb before any application code.

Today the app still uses CLIP for embeddings and Redis for vector storage and search, except Rust now handles the image and video processing pipeline and all the file I/O to let users browse their entire machine, not just indexed files.

For the UI, we decided to rebuild it from scratch instead of porting over the old UI. This turned out well because it resulted in a cleaner, simpler UI after living with the complexity of the old version.

The trickiest part of the migration was learning Rust. LLMs definitely help, but the Rust/Tauri community just isn’t as mature compared to Electron. Bundling Redis into the app was a permissioning nightmare, but I think our solution with Rust handles this better than what we had with Electron.

All in, the rebuild took about two months and still needs some more work to be at total parity with its Electron version, but the core functionality of indexing and searching files is way more performant than before and that made it worth the time. Sometimes you gotta throw away working code to build the right thing.

AMA about Rust/Tauri migration, Redis bundling nightmares, how CLIP embeddings work for local semantic search, or why Electron isn't always the answer.

Show HN: I rewrote my Mac Electron app in Rust
desktopdocs.com

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

#4
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-

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

#5

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

Thanks for checking it out. The goal is for Desktop Docs to be cross-platform. We've had a lot of requests for Windows support, so we chose Rust to set us up for an upcoming Windows version.

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

#6

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

Thanks for checking it out. The goal is for Desktop Docs to be cross-platform. We've had a lot of requests for Windows support, so we chose Rust to set us up for an upcoming Windows version.

App looks great, I'm on Windows so I can't wait to see it!

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

#7

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.

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

#8
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.

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

#9

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

Thanks for checking it out. The goal is for Desktop Docs to be cross-platform. We've had a lot of requests for Windows support, so we chose Rust to set us up for an upcoming Windows version.

Have you started your windows version testing? Any issues you've seen in the differences between browsers tauri would use on the different OSs?

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

#10

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-

[deleted]
Post reply on HN