Hacker News new | past | comments | ask | show | jobs | submit login

How does this compare to Tauri?



Wrote about that here in our readme:

https://github.com/dioxusLabs/dioxus/?tab=readme-ov-file#dio...

Tauri puts your frontend in the webview and you need to communicate with native Rust functions through an IPC boundary (like electron).

In Dioxus your Rust code lives on the native side, so you don't need IPC to do things like read from the file system, websockets, etc. Tauri also forces your frontend to compile to WASM, and a lot of interesting rust crates don't compile to wasm.

It's a little hard to express how much simpler it is to build when you don't have an IPC boundary. Dioxus' tooling is also dedicated to just Rust, so you can go from zero to bundled `.app` in less than a minute (12 seconds fresh build, 20 seconds fresh bundle).

That being said we're huge fans of Tauri and the flexibility it gives you (frontend in whatever web-compatible UI you want) and you can even use Dioxus in your Tauri apps!


I see what you mean, but to a reader unfamiliar with tauri this makes it sound really bad.

Here's how I use tauri:

Almost everything is native rust in the "backend" process, which is where main is. I don't need any ffi calls to write files, open ports, etc, it's a normal rust program that happens to have a web view.

So I've never had a problem with compiling to wasm, the GUI is TypeScript and the business logic is aot rust

The ipc boundary is annoying. It'll be faster in tauri 2, but in 1 it uses json or something internally, so you couldn't e.g. write a video player that uses a custom rust codec. Getting uncompressed video frames through ipc would kill perf

I'll take a look how dioxus solves this


One of this release's features is getting byte streams into the webview using custom protocols. It's not as ideal as say, sharing a GPU texture with the webview, but powerful enough to do video streaming and data viz.


> Tauri also forces your frontend to compile to WASM

I’ve been using Tauri (1.x) for a couple years shipping a video editor and I don’t think this is true? I went searching to verify and I couldn’t find anything saying it complies to WASM (or at least not that it requires compiling to WASM). Can you point me to where you saw this?


If you want to use a Rust frontend framework with Tauri you need to compile to wasm. You typically use svelte/vue/react etc as the frontend, or I guess you could attempt some sort of MPA approach with SSR.

Here's a guide for using Yew with Tauri. Notice how you need to install wasm-bindgen and wasm-pack. https://dev.to/stevepryde/create-a-desktop-app-in-rust-using...


Ohh sorry, I misunderstood what you were saying there. I'm just using Svelte in TypeScript and running it in the browser so it doesn't need to do the WASM step.


Whoa. Video editor is exactly what I assumed Tauri couldn't reasonably do. (See sibling comment - I also haven't used wasm since my UI is all TS)

How'd you get that working?


I initially ran into that issue too (sending frames over IPC was not gonna work!) so I create a native OS-specific overlay and draw on it with wgpu.

The IPC layer has been a bit annoying and I'm looking forward to Tauri 2 where that'll get faster. I've worked around it for some stuff in the meantime by using a custom protocol and serializing stuff to binary.


I clicked through to ask this, as well.

I appreciated Dioxus directly addressing that in the README, but would also be interested to hear experiences from people with experience using both of them.

With Tauri, I built a toy desktop app to see whether the IPC was fast enough that the web frontend could update and do stuff on every keystroke without lagging (yes), and whether it could send a big file roundtrip from the frontend to the Rust layer and back to the frontend on every keystroke (no, not in my naive toy implementation anyway).

It seems like there's be many use cases where either Tauri or Dioxus would be fine, and some use cases where Dioxus would be better. Would love to hear comparative experiences, or even "we chose Dioxus|Tauri for our project because of X and Y" type stories.

Dioxus looks really cool, and I'm excited to try it.


Tauri and Dioxus both share a webview and all of Tauri's extensions/plugins work with dioxus, so the only real difference is where your code lives. Since Dioxus and Tauri share a good deal of architecture similarities, it's not really an "either/or" case and I'm sure whatever the Tauri folks try to monetize will work with Dioxus apps automatically.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: