Gio news, August 2019

Message ID
DKIM signature
Download raw message

Much has happened since the first public release of Gio
in late March. For those who don't follow the project closely,
this is a brief summary of Gio development and news in the
last 4 months.


I presented Gio at the Gophercon conference in San Diego.
The slides and demo programs are available here:


See the slides online here:


The recording of the talk is not yet available.

    Scatter - scatter.im

The Gophercon talk also introduced my first "real" Gio
program, Scatter.

Scatter uses the Signal protocol for end-to-end encrypted
messaging and uses your existing email host for message
transport. In other words: Signal with email adresses instead
of phone numbers.


Gio can now run the browser through WebAssembly and
WebGL. The gio tool's `-target js` flag outputs a directory
ready to serve.

    Garbage free redraws

Gio programs re-specify their entire UI from scratch at every
update. When Gio was released all draw operations, input
handler declarations etc. were added as nodes to a tree
representing the entire UI, and then thrown away after
use. This was a wasteful design that put a  lot of pressure
on the garbage collector.

With the updated design, operations are all serialized to a
ui.Ops buffer of data and references (e.g. images) that
can be re-used. All operations, including complex ops
such as paths for clipping all stay on the Go stack and
don't generate garbage.

     Explicit layout

Many layout tasks such as padding, margin, centering etc.
are most conveniently encoded directly in program source
code. With the help of a few special operations (macros
and stack operations), all transient layout tasks can now be
expressed as Go structs in a direct and garbage
free manner.

    Unified input

Gio now joins all input (key, touch, mouse etc.) in a single
interface with one method, input.Queue. The Queue
implementation in app.Window now automatically takes
care of distributing events to the correct handlers.

    func main()

Through sneaky linker tricks, Gio executes the Go main
functions even on mobile platforms, resulting in much less
boilerplate and no need for init functions to create and run
a window.


The gio tool now support the -buildmode flag similar to
the Go command. -buildmode=exe (the default) creates
apps ready to install and run, and -buildmode=archive
creates archives for use with existing projects.

 - elias