Google equips Go with an experimental cross-platform UI

Bare-bones GXUI cross-platform UI library is garnering interest on GitHub, given Go's lack of native GUI support

beakers laboratory experiment
Credit: Pixabay

Google's Go language is gaining GUI support after "a couple of Googlers as an experiment" put together the bare bones of a cross-platform UI library, according to the company.

One of Go's more appealing features is the ease with which it can be deployed cross-platform, but the standard libraries for Go don't provide GUI support. Any bindings between Go and a particular platform's GUI have to be rolled by hand or bound by way of a platform-specific library.

The GXUI library includes many basic UI functions -- viewports, font handling, polygon drawing, and common UI widgets such as text boxes, drop-down lists, and progress bars. The entire library is available under a liberal MIT-style license.

But for a library intended to be cross-platform, GXUI isn't very cross-platform as yet. The instructions only have details for how to build on Linux -- not on OS X or Windows -- and even that Linux build involves a number of external dependencies.

Disclaimers also abound on the project. According to the project's README file, "The code is currently undocumented, and is certainly not idiomatic Go. It will be heavily refactored over the coming months." Consequently, it's probably not suited for production use, both because of its instability and because any attempt to use the code requires reading it in depth.

What's more, GXUI is not billed as an official Google offering. Rather, it's "code that happens to be owned by Google ... written by a couple of Googlers as an experiment, but with help of the open-source community GXUI could mature into something far more interesting." Any contributions to the library will require a signed contributor license agreement. Many other companies, such as Joyent and Red Hat, are dispensing with such agreements, but the GXUI authors cite potential patent issues as a reason for requiring it.

Rudimentary as the code is right now, there's clearly interest in the project. In the space of a month, GXUI has already accumulated more than 2,000 stars and 100 forks on GitHub.

Other Go projects exist for providing bindings to common GUI frameworks: The go-gtk project allows Go to make use of GTK (used, for instance, in Python), and the walk framework was built to allow Go to use GUI elements in Microsoft Windows. A third project, ui, works cross-platform and is receiving a good deal of development.

Go has become notable mainly for server-side applications such as Docker, rather than anything written for the desktop. Whether that's because of idiosyncrasies in the language itself or the lack of native GUI support should become clearer once projects like GXUI are used more commonly in production.

From CIO: 8 Free Online Courses to Grow Your Tech Skills