aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2026-01-03 16:16:37 -0700
committerMelody Horn <melody@boringcactus.com>2026-01-03 16:16:37 -0700
commit4fa5ed06935e0ea612b5413961e3297b5f2bee78 (patch)
tree089522f422e2cf8a7cda0cbf1eac96e5b5b83de4
parent01fa0fda5d98435519268e9dc94c409db42b7aa3 (diff)
downloadboringcactus.com-4fa5ed06935e0ea612b5413961e3297b5f2bee78.tar.gz
boringcactus.com-4fa5ed06935e0ea612b5413961e3297b5f2bee78.zip
mention tauri-specta for type safe tauri IPC from TS
-rw-r--r--_posts/2025-04-13-2025-survey-of-rust-gui-libraries.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/_posts/2025-04-13-2025-survey-of-rust-gui-libraries.md b/_posts/2025-04-13-2025-survey-of-rust-gui-libraries.md
index 8afc523..ac2bb75 100644
--- a/_posts/2025-04-13-2025-survey-of-rust-gui-libraries.md
+++ b/_posts/2025-04-13-2025-survey-of-rust-gui-libraries.md
@@ -1050,6 +1050,8 @@ and this is all just misery upon misery.
Half the point of Rust is the sheer quantity of bugs that it can catch at compile time, and if your IPC is just tossing strings around and praying at runtime, you may as well be just writing vanilla JavaScript.
(I checked, and even if your frontend is TypeScript, the `invoke` IPC boundary just takes a `string` rather than a union of the actual legal values.)
+*edit 2026-01-03*: I learned at the [Utah Rust meetup](https://www.meetup.com/utah-rust/) that if you’re writing your frontend in TypeScript you can use [tauri-specta](https://github.com/specta-rs/tauri-specta) to generate type safe IPC wrappers.
+
Hilariously, the Tauri docs [claim](https://tauri.app/develop/calling-rust/) that the command mechanism is “for reaching Rust functions with type safety”, as distinct from their event system, which is even less type safe.
With events, you’re tossing strings and arbitrary JavaScript payloads around in both the frontend and the host, so technically it’s not false to claim that only doing that on one end is more type safe, but type checking only at one end is like putting a lock on your bike but not running it through the bike rack: you aren’t tying two things together, you’re just tying one thing to itself and praying.
Even to the limited extent that half of type safety could be useful, though, they’ve picked the wrong half: there’s inherently only one implementation of the command, but there can be many calls to it, so it’d be far more valuable to have type safety at the call sites than at the implementation site.