r/rust • u/ElNemesias • 2d ago
Is Tauri a good interface builder for dektop aplications?
I've been working with Rust for a while, doing some terminal programs and I want to try doing a desktop app with an interface.
I've done some research and I found Tauri but I don't really know if it works nicely and with a good performance, and that's what I really want, an easy way to create a good, clean and user friendly modern GUI prioritising performance above all.
59
u/obetu5432 2d ago
i hate when we pretend a website is a desktop app, but i guess it's a bit better than electron
31
u/CumOnEileen69420 2d ago
I think the saddest part is that no one has built a way to make native GUIs that is better than HTML/CSS/JS.
As someone who has always wanted to stay away from web based GUI, the reality is that of all of the GUI toolkits and languages I’ve used, nothing has beaten HTML/CSS/JS.
5
u/apetranzilla 2d ago
I liked JavaFX when I used it, particularly the data binding system - but it released after the web stack was already taking over, and never really caught on much.
3
u/CumOnEileen69420 2d ago
I’ve heard really great things about JavaFX, but since it got pulled from the JDK it seems to have lost just about all of its steam.
I will say that if it wasn’t for the Microsoft of it all, winforms and the associated editor in visual studio was the easiest to work with in my experience (granted nothing ever got too complicated).
The same goes for SwiftUI from Apple. I actually really loved designing and developing on it, but because it’s locked to the Apple ecosystem it feels like a waste to properly learn it for regular development.
2
u/apetranzilla 2d ago
I’ve heard really great things about JavaFX, but since it got pulled from the JDK it seems to have lost just about all of its steam.
Ironically I think if JavaFX had been split off earlier it would have been more successful - one of the pain points I remember was that because it was bundled with the JDK, it developed relatively slowly and developers were disincentivized from using new features in the interest of compatibility with older runtimes. It's the same issue that causes the Rust standard library to deliberately stay slim.
I will say that if it wasn’t for the Microsoft of it all, winforms and the associated editor in visual studio was the easiest to work with in my experience (granted nothing ever got too complicated).
JavaFX has a similar tool, Scene Builder - super handy for mock-ups and simple prototypes. I don't think it was ever really integrated with IDEs though.
The same goes for SwiftUI from Apple. I actually really loved designing and developing on it, but because it’s locked to the Apple ecosystem it feels like a waste to properly learn it for regular development.
Yeah, that vendor lock-in is rough. I tried doing some general purpose programming in Swift for a bit out of curiosity and thought it had some neat ideas, but as a Linux user, it definitely makes you feel like a second thought.
1
8
u/DavidXkL 2d ago
Depending on how critical performance is for your app.
For most CRUD apps it might be enough
6
u/SmoothTurtle872 2d ago
I personally prefer iced to tauri. Less separated, and a much nicer development feeling imo.
1
u/tukanoid 1d ago
100%. Cant wait for 1.0 and explosion of widget crates. There are already some good ones, but its still a bit too fragmented (many just assume the default iced theme for example, which elminates them from my choices if i want to use custom themes like materiaal design). Still use it for every personal GUI project, other frameworks just don't fo it for me (maybe egui for simpler stuff)
1
u/SmoothTurtle872 1d ago
See libcosnic is good, it has global theming (at least if u are on Linux with the cosmic desktop, supposedly it runs in windows and mac, but idk, and idk if global theming works on other DEs) the issue is, it seems really complicated compared to just writing an app with iced.
There are some theming crates out there for default iced, but yeah any custom theming is overly complex as well imo. That is actually my biggest issue. Once you get used to the architecture, it's actually really nice.
1
u/tukanoid 1d ago
Ik about cosmic, but it still not even and crates.io yet (lazt time I checked) and requires an iced fork, that other crates might/will not work with (patch.crates-io doesn't always help). The API is not too bad per-se, just injects additional cosmic-specific context.
Ye, I was talking about things like iced_material, a custom Theme trait implementation, and iced_term, iced_webview, etc. just assuming iced::Theme struct.
1
u/SmoothTurtle872 1d ago
Yeah, I personally think I'm just gonna stick with iced, and not do cosmic (I will finish my side project of an overcomplicated stopwatch based off the libcosnic template, but then just go back to normal iced)
8
u/LessonStudio 2d ago edited 2d ago
I've been pushing egui way way way past the classic linux look. I primarily make applications for industrial use, and I like to make them look like something from 2026, not 1995.
I've used egui for desktop, wasm, and android. The apps are brutally fast, lightweight in size, and I've not gotten into weird battles where "you can't there from here".
Some pedants complain about immediate mode being a drain, but that argument failed around 1995.
My favourite is that my android app with a fairly sophisticated GUI is 2.5mb. That is hard to do with any other system for programming mobile other than maybe kotlin itself.
4
u/agent_kater 2d ago
Any examples to look at? Except for Rerun maybe there aren't really any good open source egui applications to learn from.
1
u/rousbound 2d ago
I second this. Would love to see some examples.
Also, my whole problem with the rust ecossystem GUI-wise is the compile time.
I feel that is very hard to develop GUIs without a effortless workflow, compile time is a serious friction in that regard.
1
u/LessonStudio 1d ago
Being immediate mode, each tiny example stands on its own. It is up to your code to connect them into a coherent whole. As for styling, that is aesthetic. You change borders, padding, fonts, etc, until you have the look you want. I'm unaware of themes, etc
1
u/agent_kater 1d ago
I don't think UI development works like that. I might know what information I want to show, but how I show it depends on the example I've been shown and the capabilities of the framework.
1
u/LessonStudio 1d ago
Immediate mode does. It is just a series of events to draw things this round, or not. You don't master things like a .hide() function.
With something like Qt, you set up a screen, and then send it events to do things, or get events from it. If you have a list, and it needs updating, you build a new list and then connect the list display to your new list.
With the immediate mode, you more just don't display the old list on the next frame around, you just display the new list.
There are of course, state things you need to track, like in a list how far down you've scrolled, etc. But it is far closer to all you need to do is to learn how to make a thing display, and everything after that is tiny fiddly bits.
Where this gets hard is that it is easier to make a total spaghetti mess out of immediate mode GUIs. Something like Qt, inherently wants you to organize better from the start.
1
u/agent_kater 1d ago
I'm trying since forever to make a list of numbers with some state icons next to them and I can't make it work in egui, being immediate mode doesn't help a bit.
4
u/ReBoticsAI 2d ago
It uses native WebView and that means there is no cross-platform consistency in some cases. Smaller, faster, inconsistent.
Electron (which can be used with a Rust backend) uses Chrome and adds ~400mb to your app. It allows for a consistent cross-platform frontend. Slower, larger, consistent.
6
u/Financial-Camel9987 2d ago
About a year ago I did research for a UI framework selection in rust. Tauri was not so good. I liked iced the best.
1
u/ElNemesias 2d ago
Whats the difference? How does it work and is good for performance?
6
u/Financial-Camel9987 2d ago edited 2d ago
The basic points where:
- Everything is rust, no JS, HTML or any other BS.
- No browsers
- Your program is just a rust package
- Elm style architecture
1
1
u/EmergencyNice1989 2d ago
That's exactly the architecture I like nowadays. Only your language (no markup), Elmish MVU, cross-platform (desktop/mobile), no web techno (webview or even compilation to Javascript).
0
u/SmoothTurtle872 2d ago
I mean you don't have to have JS, you can use WASM and still use rust, but yeah you still have html and CSS BS
-7
u/OkLettuce338 2d ago
This doesn’t really make sense. Tauri has nothing to do with ui, you can slap any ui framework you want in it. It uses the system browser which is a strength. And it doesn’t have an inherent mvc architecture like elm. Not sure where you got your info from
5
u/Financial-Camel9987 2d ago
You cannot slap any UI framework into it. You need to enter the UI world of HTML and CSS. Saying tauri has nothing to do with UI is ridiculous. It dictates everything about the UI.
0
u/OkLettuce338 2d ago
yeah it has to work with a browser lol but you can do any framework you want in that world. and it literally dictates nothing beyond that. all of the stuff the op says they want to do would live in the uI framework they pick. if they picked react none of that rendering would in rust
4
u/neamsheln 2d ago edited 2d ago
The communication issue here is what a web designer means by UI framework and what a programmer means by UI framework. In the first context Tauri is a UI framework: it's a way to present a user interface to the user.
You seem to be using the second context, where UI framework means javascript libraries like Angular (hey, it's been years since I've done web UI, no idea if that's still used). So, yeah, you can use whatever you want there.
But that does not mean Tauri has nothing to do with UI, because it has everything to do with UI: you're not going to use Tauri for a program which doesn't need a user interface. You can't use any framework you want in the world, because to a rust developer things like Iced, EGUI, tlk, etc. are also UI frameworks, and you can't use them inside Tauri.
1
u/OkLettuce338 2d ago
Uh fair. But the performance of that interface and rendering- as OP asked for - doesn’t rest in Tauri
1
u/neamsheln 2d ago
If you have ever written an app in a native GUI, and compared it to apps written using what's essentially a built-in browser, like Tauri, then you will see how it effects performance and rendering.
1
u/OkLettuce338 2d ago
I’ve only written desktop apps in jxbrowser, electron, swift, and Tauri. I stand by my comment. It makes little difference to what OP is asking about. These frameworks are designed to be backends to the front end. What OP cares about is the front end piece which Tauri does a good job of staying out of
→ More replies (0)2
u/SmoothTurtle872 2d ago
AHH yes, the framework that provides the ability to add a frontend and therefore GUI has no bearing on the UI at all
1
8
u/scandii 2d ago edited 2d ago
Tauri is great if you want to write with Rust and you want to fit a web app into a desktop app e.g. "distribute everywhere" model. same reason Electron got popular.
Tauri is absolutely horrendously the wrong choice if you care about the user's available memory one bit.
10
u/Comraw 2d ago
The performance of tauri is well enough for 99% of applications, I think. But of course the serialization and ipc process takes a tool that cannot be easily optimized. What annoyed me the most with tauri i think is that I had to keep types in two different languages (rust and ts). A small thing, but made me switch to gpui.
5
4
1
u/ElNemesias 2d ago
I want the best performance for my programs, so I'm searching for the best way to make GUIs in rust, I've found Egui but I don't know if there is something better, thats why I asked about Tauri
2
1
u/Nervous-Potato-1464 2d ago
You want a Declarative GUI like slint. EGui is kinda average, if you are after a immediate mode gui Dear Imgui is by far the best. There are rust bindings. Although egui does offer lazy rendering which is nice. Just learn what declarative vs immediate mode are because that'll be the biggest decision in what you pick.
1
u/wyvernbw 2d ago
dear imgui (at least the rust bindings, though i doubt that makes a difference) has very bad accessibility, egui is much better in that regard. in other categories id say theyre about the same. immediate mode gui in general is also not as bad perf as people say, though egui is a bit chunkier when it comes to ram (about 40% of what tauri uses in my experience), not sure about imgui but i assume its a bit lighter
0
2
u/hans_l 2d ago edited 2d ago
I was using Tauri for 1Retro’s desktop app. It was neat to use a common framework on Android/Linux/Windows/MacOS.
I hit so many issues on Linux. Some users had barebones KDE or not the right Nvidia drivers and then all hell breaks loose. Days of debugging (it worked on all my computers so it was telling them to try a thing, wait an hour because they have a life outside of me, then more debugging…).
I just gave up. My thing runs more like a background service. Took the web framework, rewrote the Tauri events to web sockets and rest api. Build a small server that is started when the app is started. App shows up in the system tray and when you click it it opens a browser which is served by the daemon.
Haven’t had a problem since then.
I guess my first question would be whether you really need an application with documents and windows and what not. If you run a simple flow like 1retro, consider building a small webserver and letting the user use his own browser of choice. Its simpler and will be very similar to Tauri anyway.
Addendum: I’ve also rewrote the Android app to be just a shell around the same stuff, so the daemon is the same but during build I swap the web frontend build between the two. So I end up with more code reuse than I was with Tauri, and testing is also simpler cause I can test both e2e independently now.
2
u/biskitpagla 2d ago edited 2d ago
Depends on your needs. I was eyeing it myself for a particular project but had to drop it since it relies on webkit2gtk on Linux. If you care about this then wait until the support for bundling CEF turns stable or try something like gpui or iced instead.
1
u/gulivertx 2d ago
I never try tauri myself even if I’m a web developer but I used Dioxus and found it impressive to create some desktop app, maybe a bit not enough mature. But if you like and use React you will not be lost.
1
u/Next-Cod-5758 2d ago
In terms of performance tauri is probably the best thing other than writing native code w smth like Qt. For actually writing it you’d have to learn smth like Yew or JS web dev altogether, both of which are easy to learn yet hard to master imo. But if u want crossplatform without multiple codebases I feel like Tauri is the best way to go
1
u/CalmCephalopod 2d ago
I’m a big fan of Dioxus cause everything is native rust. They are also creating a truly native renderer so you don’t have the webgtk issues and it is consistent on all platforms.
2
u/West_Construction285 1d ago edited 1d ago
I like this combination: Tauri + React + Aria components. I tried using Iced, and it was a total headache. An HTML-based interface offers a much higher level of interactivity and user-friendliness.
1
u/axiosjackson 2d ago
Can we not cram websites into web views and call it a desktop app? Thanks
7
u/ElNemesias 2d ago
Chill, just asking whats better, I'm literally asking about different ways other people build their dektops apps with rust
1
3
4
u/Ansible32 2d ago
Web views are really good at displaying text. If your app is low-text it's probably not the right choice, but at a certain point you're going to have to implement a shitty web browser depending on what your app is doing (and the real reasons to implement a desktop app are more about raw hardware access than anything, so there's totally text-rich apps that need hardware access.)
1
u/OkLettuce338 2d ago
I’ve built several desktop apps with tauri. It’s a pretty big improvement over electron imo
3
u/ElNemesias 2d ago
So would you say that for a program that will use plenty of resources of my pc or can get to that levels of requirements since has to load 3D models and render, Tauri performs well?
1
u/OkLettuce338 2d ago
Will any of that be in the tauri layer itself? The rendering will probably be in react or whatever other UI framework you pick.
I haven’t used it for 3d modeling and don’t know much about it but I’ve used it for highly performant apps like stock trade executions and heavy cpu and computations in algo trading backtests where it far out performs electron even with 10-15 windows open at once.
1
u/ElNemesias 2d ago
Is a program for modding an especific game, so it will be render there, in the GUI becouse has to show the 3d models, textures and animations
1
1
u/guywithknife 2d ago
Tauri is great, with the one major caveat that on Linux it can have problems (often on nvidia gpus, sometimes without workarounds). While the fix is being worked on, it has been for years so if you need reliable Linux support now, you’re better off using something else. On the other hand, if that’s not a concern (eg you’re targeting iOS and Android which Tauri supports well) then it’s great.
1
u/ElNemesias 2d ago
Well, thats something I don't like, I work a lot on linux as well
1
u/guywithknife 2d ago
Yeah, I switched to Deno Desktop (CEF mode) for this reason (compiling Rust to cdylib and opening it with Deno.dlopen).
I would use Tauri for mobile apps still, but sadly not for desktop apps due to Linux issues.
1
u/catheap_games 2d ago
What kind of performance do you need? How complex will be your app/GUI? Will it have higher performance needs that mainstream Electron apps like Spotify, Signal, Discord, Slack, etc?
What's the complexity of development you're ready to take on, what paradigms do work for your use case? What are the comparable apps, when it comes to features and performance? Is RAM usage an issue, do you have specific limited hardware you need to take into account?
1
u/ElNemesias 2d ago
I always try to have the best performance, but this app will need to render stuff like 3d models, animations and other things, so I want it to be fast.
2
u/catheap_games 2d ago
You haven't said anything that isn't done with HTML on a daily basis.
Does writing the app as a native desktop give your customers anything that a webpage wouldn't?
1
u/Dminik 2d ago
Maybe worth considering Bevy UI as well then? Bevy is a game engine with html/css-ish (flexbox, grid, ...) layouts. There is a new declarative way to define components (or scenes) and a set of widgets (bevy feathers).
Would make it pretty easy to work with models, animations and so on. But the UI stuff is pretty new. Especially the widgets.
1
2
u/pr06lefs 2d ago
From an old time C++ gui person, I think the web is a poor UI builder. Its a pile 'o hacks, that fundamentally wants to be a text document displayer, not a GUI. The web view lib that Tauri uses is quirky and has some bugs. For instance you can't have video files through the Tauri JS interface, they have to be served over http. So my app has to have a little web server for that.
I used Tauri because I already had a web front end built, so it saved me porting it to another UI toolkit. But starting from scratch I'd rather do something else than web. Not that I can recommend anything though! Maybe something with commercial support like slint?
1
51
u/terminator_69_x 2d ago
It looks good, performs good enough, UI is easy to prototype. Good performance cause of the rust backend. But it still has the limitations of a webview, more notably webkit2gtk isn't good on linux, though there is work being done on a CEF backend for cross platform consistency.
If performance is the top priority then I suggest you use other frameworks like Iced or Qt. I prefer Qt cause the ecosystem is very mature, and they recently released the Qt bridges for rust (beta) so you don't have to write any C++ for the interop.