<i>Tauri – Electron alternative written in Rust</i> - <a href="https://news.ycombinator.com/item?id=29807022" rel="nofollow">https://news.ycombinator.com/item?id=29807022</a> - Jan 2022 (419 comments)<p>(The cutoff for dupes is a year or so: <a href="https://news.ycombinator.com/newsfaq.html" rel="nofollow">https://news.ycombinator.com/newsfaq.html</a>)
In my curious search for lighter Electron alternatives to implement Zoho Writer's (<a href="https://writer.zoho.com" rel="nofollow">https://writer.zoho.com</a>) desktop app: I found Sciter[1]<p>It supports multiplatform app development with HTML/JS/CSS and the entire engine's runtime is just about 5MB which is unbelievably small!<p>I further analysed how this was possible, what I found was beyond fascinating.<p>1. The author has wrote a compiler that supports JS with useful extensions like classes and fancy stuff, even before ES6 came into existence.<p>2. He had built his own layouting engine that understands HTML and CSS 3.0<p>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.<p>The project is not even new. It's more than a decade old which itself is amazing.<p>[1] <a href="https://sciter.com" rel="nofollow">https://sciter.com</a>
Not to rain on the parade, but:<p>- 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?<p>- 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.
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 ( <a href="https://github.com/tauri-apps/tauri/blob/next/audits/Radically_Open_Security-v1-report.pdf" rel="nofollow">https://github.com/tauri-apps/tauri/blob/next/audits/Radical...</a> ).<p>The project encouraged me to better my own workflows too, as even the awesome-tauri repo requires signed commits in the PR template :) ( <a href="https://github.com/tauri-apps/awesome-tauri/blob/dev/.github/pull_request_template.md" rel="nofollow">https://github.com/tauri-apps/awesome-tauri/blob/dev/.github...</a> )
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).<p>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: <a href="https://ditzes.com/" rel="nofollow">https://ditzes.com/</a>).<p>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 <a href="https://ditzes.com/item/31764015" rel="nofollow">https://ditzes.com/item/31764015</a> 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: <a href="https://ditzes.com/item/31742590" rel="nofollow">https://ditzes.com/item/31742590</a> (1001 comments)<p>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.<p>The Tauri-part of the source can be found here: <a href="https://codeberg.org/ditzes/ditzes/src/branch/master/src-tauri" rel="nofollow">https://codeberg.org/ditzes/ditzes/src/branch/master/src-tau...</a><p>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.
This looks fantastic, and Electron needs some competition.<p>That said, here's my set of hesitations as an Electron app developer (Beekeeper Studio - beekeeperstudio.io).<p>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.<p>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.<p><pre><code> - 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.
</code></pre>
3. The only Linux build is a DEB.<p>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.
This seems a very interesting addition to the Rust ecosystem. I wonder how much traction it will get, though.<p>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 <i>immense majority</i> of application development out there...<p>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.<p>Thoughts?<p>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)
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.<p>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)<p>I'm more interested in where Tauri will go next in terms of support - not where it is on day 1.
An alternative to Electron I like is Vercel Pkg
<a href="https://github.com/vercel/pkg" rel="nofollow">https://github.com/vercel/pkg</a> .<p>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.<p>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.<p>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.<p>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.<p>Plus there is a benefit to coding both the server and the client in the same language.
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.<p>I have a small `hello-world` example of a rust-only Tauri application at <a href="https://github.com/Japanuspus/tauri-from-rust" rel="nofollow">https://github.com/Japanuspus/tauri-from-rust</a>
Here is another one <a href="https://github.com/wailsapp/wails" rel="nofollow">https://github.com/wailsapp/wails</a> 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.<p>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
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.<p>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.
Coincidentally I enjoyed this article yesterday about using Tauri and React to quickly build a desktop app: <a href="https://betterprogramming.pub/how-i-created-the-focus-app-using-react-and-rust-fd8fd072d1a7" rel="nofollow">https://betterprogramming.pub/how-i-created-the-focus-app-us...</a>
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.<p>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.<p>I know mobile is a whole other beast, but I hope Tauri can also crack this one up. That would be amazing.<p>Tauri rocks!
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.
The other lightweight alternative to Electron is Neutralino.js:<p><a href="https://neutralino.js.org/" rel="nofollow">https://neutralino.js.org/</a>
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.
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 :)
<a href="https://github.com/tauri-apps/wry" rel="nofollow">https://github.com/tauri-apps/wry</a><p>This rocks, especially with some IPC between the "native" things like filesystem + TCP sockets -> JavaScript "bridge".
A similar project that I'm using is <a href="https://wails.io" rel="nofollow">https://wails.io</a>. It uses the native system webview and the backend is in Go. You can cross compile to Windows, Linux, and Mac.
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.<p>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.
I wonder if they've gotten around the horror of Windows distribution for native webview based apps?<p>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.
I tried to use Tauri for a personal project back in January and it was missing some basic features like windows without a topbar.<p>Have things matured meaningfully since then?
Are there any good HTML ui component libraries that people are aware of?<p>Not just styling buttons with CSS, but actual components like e.g. tab-strips?
Cmd+F accessibility: 0/0 - both this discussion and their site search. :(<p>One issue from 2019: "Tracking : accessibility (a11y)" <a href="https://github.com/tauri-apps/tauri/issues/207" rel="nofollow">https://github.com/tauri-apps/tauri/issues/207</a>
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.
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.<p>It would be good to see what it actually looks like before investing in time to build something.
Does anyone else find that the text-to-speech on the "Tauri in 100 Seconds" video sounds very unnatural?<p>Tauri seems like a step in the right direction so will be giving it a go.
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.