I tested Tauri and this is what I think of it

SailorEudes

New Member
May 12, 2023
8
1

The Tauri story: a framework for modern desktop applications
If you're a developer looking for a framework to create modern desktop applications, you've probably already heard of Tauri. But what is it exactly? And how does it compare to other similar frameworks like Electron or NW.js? In this article, we'll dive into the history of Tauri, explore its qualities and shortcomings, and show you some sample code to help you decide if it's the right framework for you.

The context of the creation of Tauri
Tauri was created in 2019 by a small team of developers who were looking for a faster, lighter way to build desktop applications. They started with Rust, a fast and secure system programming language, and built a minimalist environment around it that allows developers to build desktop applications using web technologies like HTML, CSS, and JavaScript.

Rust in the heart of Tauri, but what is it?
Rust is an open-source programming language designed to be fast, secure and efficient. It is often used for embedded systems, server infrastructures and web applications. Rust is a compiled language, which means that the source code is converted to machine code for execution. Rust is also a low-level language, which means that it offers fine-grained control over the hardware. It uses a unique property system that ensures security and protection against memory errors. This means that Rust is less prone to bugs and security holes than other programming languages. Rust is also known for its active community and ever-evolving ecosystem, which offers many useful libraries and tools for developers.

The advantages of Tauri
One of the main advantages of Tauri is its lightness. Unlike Electron, which uses the full Chromium rendering engine, Tauri uses a minimalist engine called WebView2 to display user interfaces. This means that applications built with Tauri are much lighter and faster to load than those built with Electron. In addition, the fact that Tauri is built around Rust means that applications are more secure and resistant to security attacks.

The disadvantages of Tauri
The main drawback of Tauri is that it is still a relatively young project and has not yet reached the maturity of other more established frameworks like Electron. This means that there are still bugs and problems to be solved, and that the documentation may be less complete than that of other frameworks. Also, since Tauri is built around Rust, developers must be comfortable with this programming language to use it effectively.

An example of code with Tauri
JavaScript:
fn main() {
    tauri::Builder::default()
        .invoke_handler(tauri::generate_handler![show_window])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

#[tauri::command]
fn show_window() {
    let window = webview::builder()
        .title("Hello World")
        .size(800, 600)
        .resizable(true)
        .debug(true)
        .user_data(())
        .invoke_handler(|_webview, _arg| {
            Ok(())
        })
        .build()
        .unwrap();

    window.run().unwrap();
}

Tauri in practice
Tauri is used in many open-source projects, including the Delta Chat messaging client and the Mediainfo video file analysis tool. If you're looking for examples of projects that have been developed with Tauri, check out the official list of Tauri projects on GitHub.

Examples of notable projects developed with Tauri:
  • : A hands-free laptop designed for industrial workers and field professionals. It uses Tauri for its browser-based user interface.
  • : a fast and powerful terminal emulator for Linux and macOS. Alacritty uses Tauri to create a secure and isolated desktop environment.
  • : an open-source Flash emulator that allows you to play Flash games and animations on the web without needing the Flash plugin. Ruffle uses Tauri for its user interface and to improve the application's performance.
Conclusion
Ultimately, Tauri is a promising framework for developers looking to create modern desktop applications with web technologies. While it is not yet as mature as some of its competitors, it offers significant advantages in terms of lightness, security, and speed. If you are comfortable with Rust and are looking for a fast and efficient way to create a desktop application, Tauri is definitely worth exploring.
 

Users who are viewing this thread

Top