hn.today

Porting my Electron app to Rust: 675 MB to 91 MB

sayjot.xyz43 points4 comments
Screenshot of Porting my Electron app to Rust: 675 MB to 91 MB

Jot is a capture and dictation app that turns selected text into Markdown notes. Its Rust 2.0 rewrite replaces an Electron version that occupied 675 MB with a 91 MB universal app; the download shrank from 302 MB to 44 MB. The developer argues that Electron had become unnecessary overhead: Jot’s speech and AI features already depended on native helpers, while its interface and feature logic were split across processes and connected by IPC. The Rust version puts the view and state in one process, with background threads handling work that could block the interface. Shared Rust crates now power the app, command-line tool, and MCP server, while a single OS-facing API separates platform-specific code from logic that can be tested once.

The rewrite also extends support from macOS to Windows and Linux, though Wayland prevents the global Shift-Shift shortcut. To preserve compatibility, both versions use the same vault, settings, license, and identity; unknown Markdown front-matter fields survive saves, allowing different versions to share notes. The developer checked feature parity through tests, recorded runs, and headless screenshot comparisons, with only Wayland shortcut support and release signing still outstanding. Porting speech also brought faster first-use dictation, less clipped speech, better detection of quiet words, and safer clipboard handling. The Rust codebase is slightly larger than the TypeScript one, and the young UI framework required extra scrutiny, but the result is much smaller, cross-platform, and organized around a single owner for application state.

Read on sayjot.xyz4 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Ggml v1.0.0

Ggml v1.0.0

ggml 1.0.0 removes deprecated public APIs and legacy DIAG_MASK operations, while adding configurable YaRN truncation and FP8 support. It also improves backend performance with quantized matrix multiplication, fused MoE operations, and new attention and scheduling paths. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.