Electron vs. Wails: Choosing the Right Framework for Your Desktop Application

Bruno Cordioli Machado
ArcTouch
Published in
5 min readMay 1, 2024
Wails vs Electron

Cross-platform application development has become increasingly popular, with developers seeking efficient ways to create single codebase applications that run seamlessly on multiple operating systems. Two prominent frameworks have gained significant attention recently: Electron and Wails. This article discusses their features, strengths, and weaknesses to help developers decide when choosing the best fit for their projects.

Electron

Electron is an open-source framework that enables developers to build cross-platform desktop applications using web technologies like HTML, CSS, and JavaScript. Electron was initially developed for the Atom text editor and has evolved into a flexible platform for creating a wide range of apps, including code editors, messaging services, and media players.

Key Features of Electron:

  • Chromium Rendering Engine: Electron uses the Chromium open-source project to render the application’s user interface.
  • Node.js Integration: Electron combines the power of Chromium with the Node.js runtime, enabling developers to access native operating system features and functionalities through JavaScript APIs.
  • Electron Forge and Packaging: Electron Forge is an official tool that simplifies creating and packaging Electron applications. It streamlines the development, packaging, and distribution process, making deploying applications on different platforms easier.
  • Community and Ecosystem: Electron has a large and active community, contributing to an extensive ecosystem of plugins, libraries, and tools. These resources help developers extend the capabilities of their applications and address various use cases.
  • Auto-Updating: Electron supports automatic application updates, allowing developers to push updates to users seamlessly.

Wails

Wails is a more recent framework that approaches cross-platform development differently. It delivers a desktop application that combines the effectiveness and performance of the Golang for its backend, with web technologies for its user interface.

Key Features of Wails:

  • Webview-based UI: Wails uses a webview approach to create the user interface (UI). It embeds a web browser component within the application, where developers can build the front-end using standard web technologies such as HTML, CSS, and JavaScript/TypeScript.
  • Go Language Integration: Wails allows developers to write the backend logic of their desktop applications in Go, a statically typed and efficient programming language. Go’s performance and concurrency capabilities make it an excellent choice for desktop applications.
  • Two-Way Communication: Wails enables communication between the front-end (webview) and the backend (Go). This two-way communication allows developers to pass data and events between the two layers of the application.

Performance Comparison

Electron: Electron bundles the application with a Chromium-based browser, which can consume a significant amount of system resources, particularly memory (RAM). Electron applications tend to have longer startup times than native applications due to the time needed to initialize the browser window and load the JavaScript runtime. Users may perceive slower startup times for Electron apps, especially on lower-end hardware.

Wails: Wails applications are compiled into native binaries for each platform, meaning that the application’s performance benefits from being closer to the hardware, resulting in faster execution and reduced startup times compared to interpreted scripting languages. Wails allows direct interaction with the underlying system through Go’s native API bindings leading to efficient and responsive interactions with system resources.

Ecosystem and Community Support

Electron: Electron was created in 2013 and has widespread adoption, and a strong community and developer ecosystem. The vast community of Electron developers contributes to many available plugins, libraries, and extensive documentation. Developers using Electron can find solutions to common challenges more easily and benefit from continuous improvement driven by the active community.

Wails: Being a relatively newer tech, Wails has more of a niche community of people that like building things with Golang. The Wails community is growing steadily, and the ecosystem is expected to expand further.

Size of the Final Application

Electron: The size of an Electron application starts with the framework itself. Electron includes a stripped-down version of the Chromium browser, which is used to render the user interface and execute JavaScript. This base size contributes to the overall size of the application. Also, Electron allows you to package the Node.js runtime with your application. Depending on the version and features of Node.js included, this can impact the overall size.

Wails: Wails relies on the user’s system browser for rendering web content, reducing the application’s size. Also, Wails applications are compiled into native binaries for the target platform. This means that the final application consists of only the necessary components for that platform, resulting in a smaller overall size.

Cross-Platform Packaging and Distribution

Electron: Distribution-wise, Electron’s Electron Forge does much of the heavy lifting, creating multiple types of installers for all platforms. You can use Squirrel or Wix for Windows installers. DMG files for MacOS installers. And various types of packages for Linux, like Deb and Flatpak.

Wails: In terms of installers, Wails only provides NSIS-type installers for Windows. For all the other platforms, the developer needs to create the installers themselves. Which is a bit of a problem for supporting all different platforms and operating systems

Developer Experience and Learning Curve

For developer experience, both frameworks have their advantages. Electron caters to developers familiar with web technologies, allowing them to leverage their existing skills to create desktop applications.

Conversely, Wails may require a learning curve for web developers who need to become familiar with Go.

But both frameworks are very straightforward to use and integrate into existing projects, providing numerous templates and tutorials for integration and usage. However, Electron has a slight advantage in the sheer amount of community projects using it today. Getting a similar open-source project to base your project on is very easy.

Project Use Cases

Choosing between Electron and Wails ultimately depends on the project’s specific requirements and the development team’s priorities. Here are some scenarios where one framework may be more suitable than the other:

Electron is ideal for:

  • Cross-platform compatibility is a critical requirement for your application.
  • Developers familiar with web technologies looking for a quick start in desktop application development.
  • Developing a feature-rich application where faster initial development might be more critical than minimal resource usage.

Wails is ideal for:

  • Projects where high performance and efficiency are crucial.
  • Developers are seeking a secure and statically-typed language for backend development.
  • Applications that require resource-efficient distribution, especially for low-powered devices.

Conclusion

In conclusion, Electron and Wails are powerful frameworks for cross-platform application development, each with advantages and use cases. Electron is well-suited for developers familiar with web technologies who prioritize a vast community ecosystem. On the other hand, Wails excels in performance and efficient resource usage, making it a strong choice for developers who require high-performance backend capabilities.

The choice between Electron and Wails should be based on the project’s specific requirements, the development team’s skillset, and the application’s performance needs.

At ArcTouch, we help companies create engaging apps, websites, and connected experiences. See some of our work.

--

--

Bruno Cordioli Machado
ArcTouch
Writer for

I’m a Software Engineer at ArcTouch, passionate for technology and solutions.