Tauri is one of the most promising Framework that i’ve come across in a long time
and one whose excellent and kindhearted developers have worked their ass off
to make it extremely Secure, Fast and Environmentally Friendly from the get go.
In this Article, we will look at
- What is Tauri
- Reasons For Not Choosing egui
- Reasons For Choosing Tauri for our Rust based Text Editor
- Features of Tauri
- and Finally, Tauri vs Electron
to better understand Tauri and why i think it is an excellent choice for this
and any other Rust base project that you might be making.
I said in the last article that we will start coding the Text Editor from this article
and i apologize for not fulfilling my words.
I really think that Tauri will be a great addition to your toolkit as Rust Developers
and we will also be needing it to move forward with our coding part.
So, without further ado, let’s get started!
This Article is part of Minimalist Text Editor Using Rust and Tauri Tutorial Series
- Setting Up The Development Environment for Rust Programming Language
- Creating The Rust Project Using Cargo and Understanding Rust Project Folder Structure
- Tauri and Reasons For Using It in Our Rust based Minimalist Text Editor <— You’re Currently Here :p
- Understanding Tauri Multi-Process Architecture, Core Process & WebView Process
- Understanding Tauri Inter-Process Communication (IPC) | Events & Commands
- What is Isolation Pattern in Tauri and Why you should be using it
- Security Features and Practices to understand when Developing Applications using Tauri
What is Tauri?
Tauri is an Open Source (MIT / Apache) Framework, a Box of Tools that makes it possible for developers
to create a Native Application for Windows, Linux and MacOS (Android and iOS coming soon)
using Rust Programming Language as the Backend
while still using staple Web Technologies and Front End Frameworks like
- HTML
- JavaScript
- CSS
- Svelte
- Vue.js
- React.js
- and more
to create beautiful User Interface quickly and efficiently.
Tauri is made using Rust which means that it has excellent memory safety at it’s core
and with the ideology of creating a strong defense that the developers have
you can truly be rest assured about having all the tools available to you
for minimizing the attack vectors that malicious entities can use against your application
and creating a truly secure app in the wild west world which we live in.
Not only that, the developers are also trying to make it possible for developers
to have the backend in langauges other than Rust like
- Go
- Nim
- Python
- Csharp
- and more
while still maintaining their high security baseline.
All in all Tauri is one of the most fascinating frameworks i’ve found
and i hope that you will like it as much as i do.
Reasons For Not Choosing egui
After uploading the last article,
I started going over the various GUI Library and Frameworks available on crates.io
The most promising one that I found was egui,
so I spent a couple days trying to get a grip around it.
My requirements for the GUI Library or Framework were actually pretty simple
and were mostly one that i thought the people reading this article will want like
- To be able to Make a Custom Frame Decoration
i.e. custom Frame around the application which contains minimize, maximize and close buttons. - Retain the ability to Move and Tile the Window using the new Frame Decoration we created.
- Make a Window which has Curved Edges.
- Easily style content inside application – like changing font size, color, etc
- No apparent buggy feel when using the software GUI.
Sadly, even though egui is quite polished, i was not able to achieve a lot using egui.
I was able remove the default decoration and create the new one
but i was not able to retain the ability to move and tile the software Window while only using the new frame.
It was possible to do it but only if you allow moving it
by clicking and dragging anywhere on the Window instead of just the Frame Decoration
which i felt was a very weird behavior.
I was also not able to find a way make a curved window which was funny
as literally inside the web demo had a curved edge.
While i’ll not go into details, i also did not have a good time trying to style the content.
I was able to do it but it was quite cumbersome to do so.
All in all, though egui is an excellent project and has a lot of things going for it
like the various widgets available by default
my lack of experience with it and it seemingly being set in it’s ways
caused my requirements to not be met.
And for that, though it is extremely impolite, i have to thank god
because otherwise i would not have going down the rabbit hole
and would never have found Tauri.
Reason for Choosing Tauri for our Rust based Text Editor
Tauri was able to meet all the requirements that i stated above
On top of that, it utilizes HTML, JavaScript and CSS which are staples that most developers will know.
Tauri uses OS’s WebView to render the HTML by leveraging
- WebKit on macOS
- WebView2 on Windows
- WebKitGTK on Linux.
This means that developers can keep their applications small
because they don’t need to bundle the Web Engine like Chromium with their binaries. (They can if they want to)
Most computers will already have the WebView installed by default to run a Tauri app
and if not they the binary installer can install it for the user.
Another profit of leveraging the OS’s WebView is that,
it will be kept up to date by the Operating System making the application more secure.
Now, when you use Web Technologies,
Most of the time you will need to use localhost to communicate with the backend
but with Tauri you can do so without a localhost.
This makes your Tauri App more secure as no traffic can be sniffed on TCP ports
because Tauri doesn’t use these ports to communicate with the backend,
removing an unnecessarily open attack vector for native applications.
Another point in favor of Tauri is that it uses Rust as it’s Development Language
which is renowned for it’s memory safety and speed,
and because of this memory safety a whole class of conventional attacks
just won’t work on Tauri Apps, like “Use after free”.
On top of that, Tauri has other features like
- Allowing API
- Function Hardening
- CSP – Content Security Policy Management
- Hard Decompilation
- and more.
All in all, The thorough dedication the developers of Tauri have shown
towards making the final binaries extremely secure and small, is admirable,
as not only is this a huge pro for Consumer Security
but also makes Tauri Apps tens of times more Environmentally Friendly
when compared to other similar Technologies like Electron.
And Seriously, this is just scratching the surface of all the works that the Tauri developers have done.
For more details, please visit the links below, (I really hope you will do so)
- Tauri Intro
- Tauri Architecture
- Tauri Security
- Tauri Benchmarks
- Tauri Foundations by Daniel Thompson-Yvetot – Rust Linz, February 2022
Features of Tauri
- Nodejs is not required
- Menu, System-Tray, Accelerators
- Splash Screen
- Multi Window Apps
- Headless App
- Native Notifications
- Self Updater
- Development Tools
- Secure Context
- Cross Platform
- Scoped Filesystem
- No Server Required, not even localhost
- Freeze Object Prototype
- Github Actions for building all platforms
- Works with all Web Frameworks
- Fully Audited by Third Party
- Free Updater Service by Cloudflare for OSS (Open Source Softwares)
Tauri vs Electron
This are the Official Figures by Tauri Developers
Detail | Tauri | Electron |
---|---|---|
Installer Size (Linux) | 3.1 MB | 52.1 MB |
Memory Consumption (Linux) | 180 MB | 462 MB |
Launch Time (Linux) | 0.39s | 0.80s |
Interface Service Provider | WRY | Chromium |
Backend Binding | Rust | Node.js (ECMAScript) |
Underlying Engine | Rust | V8 (C/C++) |
FLOSS | Yes | No |
Multi Threading | Yes | Yes |
Bytecode Delivery | Yes | No |
Multiple Windows | Yes | Yes |
Auto Updater | Yes | Yes |
Custom App Icon | Yes | Yes |
Windows Binary | Yes | Yes |
MacOS Binary | Yes | Yes |
Linux Binary | Yes | Yes |
iOS Binary | Soon | No |
Android Binary | Soon | No |
Desktop Tray | Yes | Yes |
Sidecar Binaries | Yes | No |
This Article is part of Minimalist Text Editor Using Rust and Tauri Tutorial Series
- Setting Up The Development Environment for Rust Programming Language
- Creating The Rust Project Using Cargo and Understanding Rust Project Folder Structure
- Tauri and Reasons For Using It in Our Rust based Minimalist Text Editor <— You’re Currently Here :p
- Understanding Tauri Multi-Process Architecture, Core Process & WebView Process
- Understanding Tauri Inter-Process Communication (IPC) | Events & Commands
- What is Isolation Pattern in Tauri and Why you should be using it
- Security Features and Practices to understand when Developing Applications using Tauri
Conclusion
Well Folks! That does it for this article.
I hope that you found this information on Tauri Framework for Rust Programming Language useful.
In the next article, we will delve more into understanding the inner workings of Tauri.
May you have success in your career whatever it may be.
See you again in the upcoming articles!
Share this post on Social Media platforms, if you think our content is great.
If you like the content and would like to follow us, we are present on the platforms below
Follow Us On Social Media
Goodbye For Now,
This is your host VP
Signing Off.
Articles On Minimalist Text Editor Using Rust Programming Language And Tauri
Setting Up The Development Environment for Rust Programming Language
Creating The Rust Project Using Cargo and Understanding Rust Project Folder Structure
Tauri and Reasons For Using It in Our Rust based Minimalist Text Editor
Understanding Tauri Multi-Process Architecture, Core Process & WebView Process
Understanding Tauri Inter-Process Communication (IPC) | Events & Commands
What is Isolation Pattern in Tauri and Why you should be using it
Security Features and Practices to understand when Developing Applications using Tauri