Member-only story
How to Build a Desktop App Using Tauri
Plot the values of a function in Rust

Chances are high that you have already heard of the framework Tauri that helps create Desktop apps. If not, no problem, in this story we are going to look at other things at their basic functionality.
You might wonder why this story is related to Rust. The quick answer is, Tauri is built in Rust and moreover uses Rust as runtime. In particular, it allows us to define our own functions in Rust and call them from within the UI! In Tauri, the UI is running in a native browser that usually has not to be shipped with the app. So the languages for building the UI are JavaScript, HTML, and CSS.
The typical way of running Rust implemented code within a browser, is to compile the code to WebAssembly. Besides the portability advantage, this also comes with some essential drawbacks. A Rust developer who uses Rust’s facilities to write super efficient and performant code (like for scientific computations, simulations, and machine learning), won’t be very satisfied if the code is compiled into a much less efficient language like WebAssembly. Moreover, when it comes to multi-threading and parallel computations, the thing with WebAssembly becomes tricky up to impossible.
In this sense, Tauri is totally different. Here we can write Rust code without any restrictions and can be assured that the code will run in production with the same performance as it was targeted for. But remember, Tauri is for Desktop apps! So if you need an application that is running on the web as well, you better go with PWA’s. At the time of writing, Tauri has serious plans to also support Mobile apps. Of course, this would become a big game changer for many other technologies (see here).
My focus, as usual, is on scientific computations. I want to present a quick setup on how to do some nice simulations of a dynamic system within Tauri (leaving the world of Python and Julia aside for some time). Some basic knowledge of Rust (see here in case you need a wrap-up) and some very…