Wails: The Next Generation Tool for Building Cross-Platform Applications, a Real Electron Alternative
Wails - Build Cross-platform Desktops Apps with Go
Wails is a project that allows you to create desktop applications using Go and web technologies. It is considered a lightweight and fast alternative to Electron for Go. With Wails, you can build applications that leverage the flexibility and power of Go, combined with a rich, modern frontend.
Wails is an ideal solution for Go and JavaScript developers aiming to create lightweight desktop apps. It facilitates a native look and feel, and allows Go to be used as the primary language in the backend. Wails is similar to Tauri, a Rust-based desktop framework, as both offer almost the same features.
Wails is a fantastic alternative to Tauri and Electron, offering numerous advantages. Let's explore these benefits in this post.
It supports native menus, dialogs, theming, and translucency. It also offers support for Windows, macOS, and Linux, and includes built-in templates for Svelte, React, Preact, Vue, Lit, and Vanilla JS.
Features
- Feature-Rich Application Building: Comprehensive cross-platform applications using native UI elements.
- Familiar Technologies: Utilizes known tools for application development.
- Speed: Quickly generate, build, and package projects using the Wails CLI.
- Native Menus, Dialogs, Theming, and Translucency: Ensures a modern app experience.
- Cross-Platform Support: Compatible with Windows, macOS, and Linux.
- Built-In Templates: Pre-configured templates for Svelte, React, Preact, Vue, Lit, and Vanilla JS.
- Go and JavaScript Interoperability: Go methods are easily callable from JavaScript.
- Automatic Go struct to TypeScript model generation: Facilitates data structure consistency.
- No CGO or external DLLs: Simplifies Windows development.
- Live Development Mode: Powered by Vite for real-time changes.
- Powerful CLI: Hassle-free application creation, building, and packaging.
- Rich Runtime Library: Accommodates modern application needs like Eventing, Logging, Dialogs, etc.
- Compliance: Applications built with Wails are Apple & Microsoft Store compliant.
- Automatic Rebuilds and Reloads: Ensures immediate reflection of changes.
- Browser Development: Allows debugging and developing in a browser.
- Production-Ready Native Binaries: CLI compiles application to a single executable, with all assets bundled.
- Customizable Packaging: Total control over how applications are built.
Wails vs Electron: A Comparison
Feature | Wails | Electron |
---|---|---|
Lightweight | Yes | No |
Fast | Yes | No |
Output Size | Small | Large |
Bundling | Efficient | Less efficient |
Native Look | Yes | No |
Community | Small community | Large |
Requirements | Go, Node and NPM | Node & NPM |
Native Tools | Yes | No |
Require Embedded Browser | No | Yes |
Dark mode | Yes (Native) | No |
Call Go Methods | Yes | No |
Use Go as a backend | Yes | No |
Supports multiple languages | Yes | Yes |
Wails is often considered a lightweight and fast alternative to Electron for Go. It allows developers to build applications with the flexibility and power of Go, combined with a rich, modern frontend.
Unlike Electron, Wails does not embed a browser, which helps keep the runtime small and the output light. Instead, it reuses the native rendering engine for the platform, leading to better performance and a smaller footprint.
Supported Platforms
- Windows 10/11 AMD64/ARM64
- MacOS 10.13+ AMD64
- MacOS 11.0+ ARM64
- Linux AMD64/ARM64
License
- MIT License