Desktop Application Development
Using a Go-based alternative to Electron
Electron set the stage for a JavaScript frontend/backend approach to desktop application development. Electron has proven to be a full-featured development environment, as demonstrated by an extensive showcase of successful Electron applications.
What if we used Go for the backend instead of JavaScript/Node.js? What if we used a bare-bones web browser utility instead of Chrome/Chromium? Consider that possibilities of a desktop application that is faster and smaller (in terms of memory requirements) than an Electron-based application. That is the promise of Wails.
With Wails, like Electron, we have a rich user interface for application development. We can use frontend code with HTML, CSS, and JavaScript, as well as frontend frameworks. We can take advantage of the power of frontend web programming tools, while realizing the performance of a native Go application running on the desktop. Think of Wails as an integrated browser and server with JavaScript and Go components.
Wails eliminates the need for specialized graphical user interfaces (GUIs) when building Go-based desktop applications.
With Wails, we build on the strengths of JavaScript and Go—JavaScript for screen aesthetics and user interaction and Go for database access and analytics.
A Wails application uses the local file system and operating system utilities of the desktop computer. A Wails application runs directly on the desktop, rather than through a browser. The frontend and backend are integrated in a single application. There is no need for a localhost server.
With Wails, the same Go code base can be compiled under Windows, Linux, or MacOS.
Despite its recent entry into the software landscape, Wails ranks highly among cross-platform GUI tools on OSS Insight. Currently, Wails cannot produce mobile apps for Android or iOS, but a detailed roadmap shows plans to add these capabilities in the future.
Detailed information is available at the Wails website and GitHub repository.
Like Electron, Wails can utilize well-established frontend frameworks, as well as innovative and exciting front-end frameworks like Svelte. It can work with dynamic, interactive visualizations facilitated by libraries like D3. For styling and transitions, Wails can incorporate various frameworks and libraries for cascading style sheets (CSS). Data scientists benefit by having such a capable desktop development environment.
What about the name “Wails”? Says its creator, Lea Anthony, after seeing WebView, “What I really want is tooling around building a WebView app, a bit like Rails is to Ruby”. So, “Wails” was a play on words, a way of creating a WebView that looks like Ruby on Rails. Lea Anthony is also from the country Wales, so the name worked for him.
This Go Time podcast concerns building cross-platform GUIs. There is discussion of Wails by Lea Anthony and Fyne, a Go GUI created by Andy Williams. These developers also give advice about working within open-source communities and maintaining public repositories that serve many users.
Back to Building Systems and Services