Hacker News Re-Imagined

Tauri 1.0 – Electron Alternative Powered by Rust

  • 715 points
  • 20 days ago

  • @Uninen
  • Created a post

Tauri 1.0 – Electron Alternative Powered by Rust


@vegai_ 20 days

Replying to @Uninen 🎙

What is the system webview on Linux, where such a thing doesn't exactly universally exist?

Reply


@jeremychone 20 days

Replying to @Uninen 🎙

Tauri is very well designed, from an app model to its component parts (wry, tao). In short, it’s a platform that allows writing Rust as the backend and use of the OS webview. So light and fast.

I think and hope that many new desktop apps, even from the new big player, will be done in Tauri. I plan to use it for some of our future apps.

I know mobile is a whole other beast, but I hope Tauri can also crack this one up. That would be amazing.

Tauri rocks!

Reply


@rathboma 20 days

Replying to @Uninen 🎙

This looks fantastic, and Electron needs some competition.

That said, here's my set of hesitations as an Electron app developer (Beekeeper Studio - beekeeperstudio.io).

1. With Electron it's nice to be able to lock the browser implementation across OSs. I'd have some pause about having to support arbitrary Webview implementations. It makes testing so much harder.

2. It's really really nice to be able to code-share between UI code and app backend code. In Electron everything is JS, so you can use the same codebase for both components. With Tauri it requires two languages and two sets of packages.

  - One example of this is an ORM for a SQLite database. I need to load some settings before the UI renders, in Electron this is the same ORM code.
3. The only Linux build is a DEB.

4. Smaller community - desktop apps are a total PITA to debug, it helps that Electron builds have been tested at length by companies like Microsoft.

Reply


@tensor 20 days

Replying to @Uninen 🎙

A similar project that I'm using is https://wails.io. It uses the native system webview and the backend is in Go. You can cross compile to Windows, Linux, and Mac.

Reply


@lynndotpy 20 days

Replying to @Uninen 🎙

That 100 second video was really very well done and convincing. I shouldn't have watched it on break because now I want to do go home and do something with Tauri :)

Reply


@jbverschoor 20 days

Replying to @Uninen 🎙

5 clocks later too check if it’s also webviews. It is, so I stopped reading

Reply


@aitchnyu 20 days

Replying to @Uninen 🎙

Why does Tauri say "faster" or "blazing fast"? I think it has same limitations as Electron, or did I miss something?

Reply


@sourabhv 20 days

Replying to @Uninen 🎙

I would honestly prefer flutter instead of relying on system web view and all of its inconsistencies

Reply


@zeandcode 20 days

Replying to @Uninen 🎙

Whatever their opinions on this project. I'm pretty much like it when start to create a small project, it's very light in terms of memory usage, also the size of the compiled binary is way smaller than electron.

Reply


@encryptluks2 20 days

Replying to @Uninen 🎙

Doesn't the browser native messaging feature already provide the ability to call native applications and create a backend language API? I guess I don't understand the need for every app to basically have its own browser engine, no matter how "lite", when I can already develop apps with Chromium that use native messaging.

I'd rather see a unified solution which pretty much exists then to have a bunch of alternatives that provide no greater benefits overall from what I can tell.

Reply


@galaxyLogic 20 days

Replying to @Uninen 🎙

An alternative to Electron I like is Vercel Pkg https://github.com/vercel/pkg .

You write a server in Node.js, compile it to an exe with Vercel Pkg and users run the exe on their local machine and use it with their browser.

Instead of running an app "in the cloud" they run it on the server on their machine. But the server could easily also be moved to the cloud as well.

Using a browser to connect to an app running on your local machine has the nice feature that you can open any number of browser-views on it, looking at the app and your data and tools from multiple viewpoints. Since it is local they are the only user and don't need to login or "keep a session" and can thus interact with the app in multiple ways in parallel.

I don't need to design in a feature that allows users to "open a new window". That is handled by the browser. Open a new tab to the same or different (bookmarked) url.

Plus there is a benefit to coding both the server and the client in the same language.

Reply


@wener 20 days

Replying to @Uninen 🎙

Here is another one https://github.com/wailsapp/wails powered by Golang, but both of tauri and wails do not support BrowserView like feature in Electron, which means you can not build a brave browser on top of them.

Depends on your skill set, wails maybe better, think building a UI based tailscale app, just make the embed web part display directly instead behind a http.Server with extra 3-5 MB

Reply


@productceo 20 days

Replying to @Uninen 🎙

Is this a substitute for Flutter? (After mobile support ships)

Reply


@SeasonalEnnui 20 days

Replying to @Uninen 🎙

Does anyone else find that the text-to-speech on the "Tauri in 100 Seconds" video sounds very unnatural?

Tauri seems like a step in the right direction so will be giving it a go.

Reply


@akmarinov 20 days

Replying to @Uninen 🎙

Shal'kek nem'ron

Reply


@synergy20 20 days

Replying to @Uninen 🎙

In an ideal world, the browser could add a desktop or smartphone mode running in a separate process with web surfing(and others like cookies etc) optionally turned off, then it becomes a true universal GUI platform.

Reply


@smdyc1 20 days

Replying to @Uninen 🎙

Name inspired by Stargate?

Reply


@AndrianV 20 days

Replying to @Uninen 🎙

I've always felt Tauri was too early to be a viable electron competitor, but now that I've seen it used in a huge project (Spacedrive), I think I might reconsider.

Reply


@CMCDragonkai 20 days

Replying to @Uninen 🎙

It's possible to embed nodejs (or V8 or demo) in a Rust binary. So perhaps we could embed nodejs into the rust backend and just run a nodejs app.

Reply


@MuffinFlavored 20 days

Replying to @Uninen 🎙

https://github.com/tauri-apps/wry

This rocks, especially with some IPC between the "native" things like filesystem + TCP sockets -> JavaScript "bridge".

Reply


@IceHegel 20 days

Replying to @Uninen 🎙

I tried to use Tauri for a personal project back in January and it was missing some basic features like windows without a topbar.

Have things matured meaningfully since then?

Reply


@sva_ 20 days

Replying to @Uninen 🎙

Sadly mobile support is still far off on the horizon it seems.

Reply


@UmbertoNoEco 20 days

Replying to @Uninen 🎙

I like it,but even a trivial app becomes a huge +5GB folder in development. The dependencies folder alone will make a node project blush + all the stuff generated when compiling/building. I love to have several apps to work on them concurrently but I wont reserve 50 Gb of my already small SSD for this stuff.

Reply


@dang 20 days

Replying to @Uninen 🎙

Tauri – Electron alternative written in Rust - https://news.ycombinator.com/item?id=29807022 - Jan 2022 (419 comments)

(The cutoff for dupes is a year or so: https://news.ycombinator.com/newsfaq.html)

Reply


@lucasyvas 20 days

Replying to @Uninen 🎙

For anyone not on board because of how the WebViews work, or that it uses WebViews at all, the roadmap has other renderers to be explored. I believe the majority of the Tauri framework is decoupled from "web" and it's merely supported first - likely through popularity.

When WebView2 goes multiplatform, you might even be able to use it on every platform (if you like web, but want a consistent browser engine on each platform)

I'm more interested in where Tauri will go next in terms of support - not where it is on day 1.

Reply


@knowsuchagency 20 days

Replying to @Uninen 🎙

Looks great but I can't find any references to how to implement a sidecar with the new documentation

Reply


@mattlondon 20 days

Replying to @Uninen 🎙

Are there any good HTML ui component libraries that people are aware of?

Not just styling buttons with CSS, but actual components like e.g. tab-strips?

Reply


@japanuspus 20 days

Replying to @Uninen 🎙

For anyone coming from the rust side and just looking for a cross-platform rust frontend framework: although not covered in any details by the docs, you can cut out all the web stuff and run everything from cargo.

I have a small `hello-world` example of a rust-only Tauri application at https://github.com/Japanuspus/tauri-from-rust

Reply


@password4321 20 days

Replying to @Uninen 🎙

Cmd+F accessibility: 0/0 - both this discussion and their site search. :(

One issue from 2019: "Tracking : accessibility (a11y)" https://github.com/tauri-apps/tauri/issues/207

Reply


@lewisjoe 20 days

Replying to @Uninen 🎙

In my curious search for lighter Electron alternatives to implement Zoho Writer's (https://writer.zoho.com) desktop app: I found Sciter[1]

It supports multiplatform app development with HTML/JS/CSS and the entire engine's runtime is just about 5MB which is unbelievably small!

I further analysed how this was possible, what I found was beyond fascinating.

1. The author has wrote a compiler that supports JS with useful extensions like classes and fancy stuff, even before ES6 came into existence.

2. He had built his own layouting engine that understands HTML and CSS 3.0

Basically he's built a custom browser engine, but custom tailored for writing multi-platform apps. So it's super-fast without as much memory taxes. It's not backed by a BigCo or a huge community (I guess) and I'm not sure whether I'll pick it for a business critical app. But the way it's architected seems far superior than the shortcut approaches that Electron or most other alternatives take.

The project is not even new. It's more than a decade old which itself is amazing.

[1] https://sciter.com

Reply


@showmeademo 20 days

Replying to @Uninen 🎙

I had a look at the tauri site a few weeks ago but could not find a single screenshot or demo app to see what it looked like.

It would be good to see what it actually looks like before investing in time to build something.

Reply


@k__ 20 days

Replying to @Uninen 🎙

If I get this correctly, Tauri is neither about performance nor size, but about security?

Reply


@Uninen 20 days

Replying to @Uninen 🎙

I find it fresh and positive that Tauri developers take security very seriously. Before this 1.0 release they ordered a full security audit for the codebase and published the report ( https://github.com/tauri-apps/tauri/blob/next/audits/Radical... ).

The project encouraged me to better my own workflows too, as even the awesome-tauri repo requires signed commits in the PR template :) ( https://github.com/tauri-apps/awesome-tauri/blob/dev/.github... )

Reply


@capableweb 20 days

Replying to @Uninen 🎙

Tauri is such a breath of fresh air for a web developer like me! I picked up Rust because of it, and was easier than I thought (I've read lots of "Rust is hard" articles).

The application I wrote is a Hacker News client with focus on offline reading and listing comments in threads sorted by time and flat, instead of trees sorted by score (which incidentally, also works as a web application which is deployed here: https://ditzes.com/).

I found it helpful when I'm traveling but still want to read discussions, useful for following along threads that are actively being discussed (this submission can be seen at https://ditzes.com/item/31764015 for example) and also useful when using HN comments as reference to something I'm building. Guess I'm also pretty proud that the client is VERY fast, loading 1000 comments in something like 1s (because of the caching). Like this thread for the Coinbase layoffs: https://ditzes.com/item/31742590 (1001 comments)

The Tauri application currently works with 99% of the features of Ditzes, but the mouse "back" button doesn't actually navigate the internal browser back in history with Tauri yet, so I haven't done a "Show HN" yet as I consider that a essential feature of Ditzes (for following along threads via the "View" link) before "launching" it.

The Tauri-part of the source can be found here: https://codeberg.org/ditzes/ditzes/src/branch/master/src-tau...

Overall, besides the extremely long compile times, Tauri has a been a pleasure to develop with, and I'd definitively use it over Electron in the future. Really looking forward to mobile support as well, as then I'll finally have a comfortable and offline-capable HN client for my cellphone.

Reply


@hdjjhhvvhga 20 days

Replying to @Uninen 🎙

The other lightweight alternative to Electron is Neutralino.js:

https://neutralino.js.org/

Reply


@petercooper 20 days

Replying to @Uninen 🎙

Coincidentally I enjoyed this article yesterday about using Tauri and React to quickly build a desktop app: https://betterprogramming.pub/how-i-created-the-focus-app-us...

Reply


@crabbygrabby 20 days

Replying to @Uninen 🎙

Been using tauri since it was in alpha for hobby project. Experience overall is pretty good. You really can call backend rust from js, in a lightweight browser window.

It is probably the most approachable technology for me for making desktop apps these days. Much leaner than electron, like it says on the tin.

Reply


@flohofwoe 20 days

Replying to @Uninen 🎙

Not to rain on the parade, but:

- What's the point of mentioning Rust when the heavylifting is done by the system's webview widget, and applications are written in HTML/CSS/JS, just as in Electron?

- Isn't the whole point of Electron to have version/feature stability for the browser APIs by bundling a specific Chromium runtime? Without this requirement, it was also trivial before Electron showed up to write a small native wrapper application around the system-provided webview widget.

Reply


@api 20 days

Replying to @Uninen 🎙

I wonder if they've gotten around the horror of Windows distribution for native webview based apps?

The usual problem is that you have to either use an antiquated IE based webview on Windows or install the Microsoft Edge runtime. The latter is painful to bundle and some people don't like it, especially enterprisey IT departments who consider it "another thing" they have to approve instead of just a part of the app since it's a separate OS component.

Reply


@j1elo 20 days

Replying to @Uninen 🎙

This seems a very interesting addition to the Rust ecosystem. I wonder how much traction it will get, though.

Some days ago there was an HN thread about Rust, conversing about the steep learning curve of Rust. The conclusion frequently is that maybe Rust is great for financial systems, kernels, rendering engines, media processors, etc... but just not necessarily the best tool for the job when there is no pressing need to avoid GC, and/or to squeeze the maximum performance while at the same time maintaining memory correctness. Which, on the other hand, tends to be the immense majority of application development out there...

So Tauri seems to me has a similar issue than the Qt Framework (built on and for C++): its adoption as an Electron alternative might not be as much as it deserves, because of the difficult to learn programming language that is behind it.

Thoughts?

EDIT: I know Tauri is just a WebView component, but programming in Rust still seems to be an important part of developing apps with it (it is even prominently featured in the 100 seconds video of the entry)

Reply


@billfruit 20 days

Replying to @Uninen 🎙

Is there something similar for C++.

Reply


@bennyp101 20 days

Replying to @Uninen 🎙

Awesome, I've been waiting for a 1.0 release to start playing around (I know its been fairly stable anyway, but still)

Reply


@torginus 20 days

Replying to @Uninen 🎙

This is 'powered by Rust' the same way my gas car with electric windows is 'powered by electricity'

Reply


@nachtigall 20 days

Replying to @Uninen 🎙

It still uses node.js, right? Since it is new and for the future, why not choosing deno?

Reply


@newbieuser 20 days

Replying to @Uninen 🎙

It would be really nice if they had their own app store or package manager.

Reply


About Us

site design / logo © 2022 Box Piper