Gio News, January 2021

Message ID
DKIM signature
Download raw message
Hello everyone!

We're already a month into 2021, and that means an entire month of Gio

core gio

In addition to normal bugfixes and contributions to the core
repository, Elias has been working to improve the functionality for
embedding Gio within other graphics libraries, primarily using
gioui.org/example/glfw. Additionally, Elias has been exploring the use
of SwiftShader to offline-compile our compute shaders to efficient
amd64/arm64 assembly. SwiftShader is a software implementation of the
Vulkan API, and you can learn more about it here:

Many people contributed features and fixes to core Gio in January:

- Elias merged the compute renderer backend for Android/Linux. You can
force its use by running a Gio program on those platforms with the
environment variable GIORENDER=forcecompute.
- Larry Clapp implemented text selection in the
{widget,material}.Editor! This was a huge amount of work over a long
time, and it works marvelously.
- The op.{Push,Pop} methods have been renamed to op.{Save,Load}. See
commit d331dd2 for gofmt rules to rewrite your code automatically.
- Elias added an op.DeferOp that allows you to render a widget *after*
the normal render pass. This enables true overlays, as they can
reliably be drawn atop widgets rendered later in the frame.
- The keyboard.{Focus,SoftKeyboard}Ops have been altered to be more
explicit. See commit e70a16c3 for details.
- Pierre Curto fixed many bugs across the codebase and:
  - updated the named cursor support so that you can change the cursor
without moving the mouse.
  - added helpers to layout.Axis to return the length of the
major/cross axis.
  - enabled material.Slider to render vertically.
  - added a field to layout.List.Position to check the number of
visible children in a list.
- Lucas Rodrigues also contributed many improvements:
  - removed the `windres` dependency from `gogio` so that you can
easily generate binaries for the windows target from any other platform.
  - fixed system insets on mobile browsers.
  - locked the wasm frame rate to the display frame rate.
- Egon Elbre added hover states to all of the material widgets.
- I fixed a bug in widget.Border that caused the border to extend
beyond the returned dimensions.


The examples module also got some love this month:

- My previous visualization of the barneshut galaxy simulation from
gonum has joined gio-example under the galaxy directory. Thanks to Dan
Kortschak for donating the simulation code under Gio's license.
- The "windows" example is now named "multiwindow" to clarify its
- During the migration of examples from gio-extras to the example
repository, Pierre Curto's demo of his table layout was lost in the
shuffle. It is now available again in the x/outlay/table directory.
- The glfw example has seen some updates to better demonstrate
integrating Gio with other GL libraries (as discussed above).


The gio-extras project has been moved to the gioui.org/x namespace.
This namespace is a set of official packages (maintained by yours
truly) that extend core Gio. Some of them are expected to join core
once their utility and stability are established. Others (ones that add
many dependencies for a niche use-case) are expected to remain in /x
indefinitely. During this migration several modules were renamed.
Here's a key to the new names:

materials   => gioui.org/x/component
haptic      => gioui.org/x/haptic
scroll      => gioui.org/x/scroll
events      => gioui.org/x/eventx
niotify     => gioui.org/x/notify
colorpicker => gioui.org/x/colorpicker
outlay      => gioui.org/x/outlay
gioprofiler => gioui.org/x/profiling

All of the source code is now in one repository here:


Another change is that these packages will now use the Gio official
mailing list for contributions (though they also accept contributions
on the GitHub mirror https://github.com/gioui/gio-x/).


I have been experimenting with integrating Gio with Yaegi (Yet Another
Elegant Go Interpreter, https://github.com/traefik/yaegi) so that you
can edit parts of your layout code  live. This has two use-cases:

- increasing the iteration speed of developing Gio GUIs,
- and creating a playground for people to try Gio in their browser.

Historically, we haven't had a browser playground because it would
require running the go compiler in the browser *or* it would require us
to provision a server farm to run the builds. Yaegi lets us dodge this
by precompiling most of the program and then only interpreting a single
package at runtime. This appears to work reasonably well in the browser
(for small packages, anyway).

Larry Clapp has been exploring the iteration speed use-case as well. It
would be really handy to be able to achieve something analogous to
stateful hot reload for Gio/Go applications. Larry has successfully
overridden the definition of a layout function at runtime (switching
from a compiled to an interpreted function dynamically). We've hit some
odd snags along the way, but I think there's still a lot of potential

You can find my PoC code here:


You can see a video of it in action here:


Additionally, Andrew Werner explored achieving the same thing using
gomacro (https://github.com/cosmos72/gomacro) as the interpreter (and
replicated my PoC). You can see his gomacro version here:


The two interpreters have very different runtime performance
characteristics, and I'm excited to experiment further with both of


Elias and I would like to thank Plato for sponsoring Gio development!
Check out their website here: https://www.platoapp.com/

Additionally, a hearty thanks to Lucas Rodrigues (@inkeliz) for
sponsoring Elias!

If Gio provides value to you, please consider sponsoring one or more of
its developers/maintainers!

Elias Naur:

Chris Waldon:

call for presentations

If you'd like to present any of your Gio-related work during the
February Gio community call, please reach out to me.

You can find recordings of previous Gio community calls here:


the end

Thanks for reading! Please reach out if you'd like your work included
in future newsletters.

Chris Waldon
Message ID
<CAFcc3FTeOFa==9CuuRFBpHLVS8VDUJeggvsq3EpXHvmgq1zc3Q@mail.gmail.com> (view parent)
DKIM signature
Download raw message
DKIM signature: fail
Excellent update. Thanks Chris!

Reply to thread Export thread (mbox)