From nobody Sun Jan 31 20:27:14 2021 Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by mail-b.sr.ht (Postfix) with ESMTPS id 47FF111F005 for <~eliasnaur/gio@lists.sr.ht>; Sun, 31 Jan 2021 20:27:14 +0000 (UTC) Received: by mail-qk1-f177.google.com with SMTP id l27so14337590qki.9 for <~eliasnaur/gio@lists.sr.ht>; Sun, 31 Jan 2021 12:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ADfpUjU+EkqqRM1cECxV4RDVxdMf9KNlpEeqq9EwFdk=; b=QW6Ih409II1FygjqHv4/Ol+BA7UKqsmC0l7dbL3SyEwaSQsTG3LOiJKSinl0jLfuAh YQf+/j3I+QNTH901aVnaEITmpUpFjYIZ0REdQY0S8hum2XOPO6Q22LWlvFcxtSTnMPmf onWR5XASYVgIVWaZ/xBscvBrRb2sC3H7g5FEoe8WN+aTuBLEsL9eGaYiEWI5vxVKsfeC /rxuUFjTxVkFo/SN0GfH+an1gLj+0HTurK7Ow+9xy+o1GprKCfXxhOfAponggzK+Wo2p VcIWzOq9nHCEvem4Q7JK6IpbCO1DwCv7eSFqyONW/kYNgkJHo/ZpMKgfYKGqdW8zqgpu bw+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ADfpUjU+EkqqRM1cECxV4RDVxdMf9KNlpEeqq9EwFdk=; b=hO3WQA91nqj4qGI43aWP276fhmKqBdKMJoZ9zsQAUT5AJWDo7KUey1rnNVoOH33zPk z02HMrhwi/CJj3iCOG4O55flVuc7KrerezI0VEt8nImbaWkG5TDD5K1ucT552RUclTQJ PBIrt0mz+37W6FypQxoHdw8VcEhi3X0pc5a0AIHOcPASZ6WB8LzoASxPU42qZhNW8n9S fnwuZ+brlD0hCT0PXxDaGAVAdd1dZsK/bULAHD4PhxMRK5klwjtQYOSHQ1sJS94RMB4h u6NgT01NXgdqnfgJNKNO5o00qUq3Mu4/T+pgvmnCQ0KdTquiM5/92adaBVSI5SoaTzvz cb4A== X-Gm-Message-State: AOAM532zGqg1183k5f1BJofxQrtwZ9FCBYs1cw2+NF3cZR6n5FyAGYud woYRWkyztvFtxDx/FH46XJiffoyEUJAs4WOwjCJsYXvC2ZoITg== X-Google-Smtp-Source: ABdhPJyvpyxncGJ1/Yp5MVTORKkbF/hONiT5YyFGa9cxEjW/oLnJV0yvGpUVCLLVGKPY5/pjYWg7yLa3NR8mz13aeok= X-Received: by 2002:a37:4c88:: with SMTP id z130mr13391948qka.122.1612124833414; Sun, 31 Jan 2021 12:27:13 -0800 (PST) MIME-Version: 1.0 From: Chris Waldon Date: Sun, 31 Jan 2021 15:27:02 -0500 Message-ID: Subject: Gio News, January 2021 To: Gio-dev <~eliasnaur/gio@lists.sr.ht> Content-Type: text/plain; charset="UTF-8" Hello everyone! We're already a month into 2021, and that means an entire month of Gio improvements! ======== 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: https://github.com/google/swiftshader 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. =========== gio-example =========== 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 purpose. - 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). =========== gioui.org/x =========== 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: https://git.sr.ht/~whereswaldon/gio-x 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/). ======================= playground/live-editing ======================= 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 here. You can find my PoC code here: https://git.sr.ht/~eliasnaur/gio-example/tree/112655e32697e0e4efdd57e100 6be4f6bc4c8176/item/livedit You can see a video of it in action here: https://user-images.githubusercontent.com/2324697/106301108-4e2fce80-622 5-11eb-8038-1d726b3eb269.mp4 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: https://github.com/ajwerner/livedit The two interpreters have very different runtime performance characteristics, and I'm excited to experiment further with both of them. =========== sponsorship =========== 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: https://github.com/sponsors/eliasnaur Chris Waldon: https://github.com/sponsors/whereswaldon https://liberapay.com/whereswaldon ====================== 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: https://www.youtube.com/channel/UCzuKUnKK5gAFJKNyA1imIHw ======= the end ======= Thanks for reading! Please reach out if you'd like your work included in future newsletters. Cheers, Chris Waldon