Re:Go 1.16 Release Notes
by KarlKode on Tuesday February 16, 2021 @04:19PM
(#26158924)
Do you know any good GUI library in go (as you mention native GUIs as a weakness.
Besides that what were you're problems with the C interop? In addition to the lack of up to date documentation for more complicated examples, I had huge problems using the C interop layer with more complicated C++ libraries (mostly because the C interop has its problems with C++).
[ Parent
| on HN ]
I have been quite happy with the Gtk bindings for Go (https://github.com/gotk3/gotk3). As Gtk has a C Api, it is a good match for Go, actually Go makes Gtk nicer than calling it from C in my eyes, as the GObject wrap to Go types and you can just call methods on them vs. the C syntax of passing the GObject as the first function argument and having the object type in the function name.
If you install the Gtk libraries on the Mac, Go programs written with gotk3 just compile and run there too.
C++ doesn't have a stable ABI, so C++ interop is usually done by wrapping a C++ library with a C interface first. This is true for most compiled languages afaik.
GUI libraries often rely on specific language features so they are hard to wrap in other languages. That's why good GUI libraries don't exist in ANY language other than the ones they were written in.
I think GUI libraries which offer C bindings are easy to wrap in other languages, that is why I like Gtk a lot. In my eyes, it works especially nice with Go. Tk should be easy to wrap for Go to, but usually one would prefer Gtk, when there is a choice :).
Re:Go 1.16 Release Notes
by xyzzy_plugh on Tuesday February 16, 2021 @07:23PM
(#26160894)
Gio is coming along nicely. Once they go full tile-based-rasterization ala Pathfinder it'll be a contender.
I have great success with https://fyne.io/ used it to build my home grown MFA app (written in Go, work on iOS, Android, Desktop). granted it takes a bit of binding in C to work on iOS.