Hi HN, I’m excited to share Spot, a simple, cross-platform, React-like GUI library for Go. It is just a few days old and has lots of missing features but I'm happy with the results so far, and looking for some design feedback.<p>Spot is designed to be easy to use and provide a consistent API across different platforms (mainly Mac & Linux). It’s inspired by React, but written in Go, aiming to combine the best of both worlds: the easy tooling & performance of Go with a modern, reactive approach to UI development.<p>Key features:<p>- Cross-platform: Leveraging FLTK[1] & Cocoa[2], Spot works on Mac, Linux, and the BSDs with plans for native Windows support in the future.<p>- Reactive UI: Adopts a React-like model for building UIs, making it intuitive for those familiar with reactive frameworks.<p>- Traditional, native widget set: Utilizes native widgets where available to provide a more traditional look and feel.<p>Why I built it:<p>I was searching for a cross-platform GUI toolkit for Go that had a more traditional appearance, and none of the existing options quite met my needs. I then started playing with Gocoa and go-fltk and suddenly I worked on an experiment to see how challenging it would be to build something like React in Go, and it kinda evolved into Spot. ¯\_(ツ)_/¯<p>In 2024, is there a still place for classic desktop GUIs—even with a modern spin?<p>I’d love to hear your thoughts, feedback, and any suggestions for improvement. Also, contributions are very welcome.<p>Thank you for checking it out!<p>[1] <a href="https://github.com/pwiecz/go-fltk">https://github.com/pwiecz/go-fltk</a><p>[2] <a href="https://github.com/roblillack/gocoa">https://github.com/roblillack/gocoa</a>
I’ll have to give this a look! I’ve been looking for a simple way to use Go to write an internal development tool which is basically just a form with some buttons and text fields. I tried Gio, but had a hard time with wrapping my head around it. Right now I’m using wails and like it much better. This looks interesting and worth a look!
"Cross-platform: Leveraging FLTK[1] & Cocoa[2], Spot works on Mac, Linux, and the BSDs with plans for native Windows support in the future."<p>I'd seriously recommend that you consider cutting this. Perhaps keep the lessons you've learned to retain future flexibility, but get good on one toolkit first. GUI toolkits, GUI bindings, GUI in general drowns you in details as it is, volunteering to drown in several different underlying toolkit's details may sound appealing because you may feel like you're growing your metaphorical market, but what you will almost certainly end up with is doing all toolkits badly instead of even one toolkit well, and that won't be good.<p>We've all heard about how the first 90% is 90% of the work, and then the remaining 10% is another 90% of the work. GUIs make that look like hopeless pie-in-the-sky optimism, where the first 10% is 90% of the work, and then the next 10% is ten times the work, and then the next 10% is another ten times the work. Trying to be cross-platform will strangle you.<p>However, based on my experience with some similar previous discussions, I don't expect you to immediately buy and agree with my arguments. What I'll <i>really</i> suggest then is to keep what I've said here in the back of your mind, and when you find you're staring down the three toolkits that rigidly require a three-way mutually contradictory way of handling rich text or something, then think back to this post and consider giving yourself permission to drop all but the best-supported and/or most popular underlying toolkit.
I have been looking for something like this in Go for a while. I think there's a real opportunity for Go to provide a great developer experience for cross platform UI due to how simple the build process is. Speaking from experience, half the pain of cross platform development is managing build complexity, which Go basically eliminates.<p>I'm curious how you'll end up solving for cross-platform layout when native controls have different intrinsic sizes per platform?<p>This is something I haven't seen solved super well in cross platform toolkits.<p>Wishing you luck though.
Was looking for something like this some years back. Though I wanted Windows support too. Ended up switching to C++ to use wxWidgets, giving me small self contained binaries.
I'm curious to hear your take on this: what's the advantage of following the virtual control tree approach compared to instead updating directly the controls that are displayed to the user?
Looks great! Thanks for sharing.<p>Would you consider listing the supported platforms in the readme? I think that would be a pretty interesting piece of information:<p><pre><code> - Windows
- Linux
- macOS
- *BSD
- Android
- iOS
- Web
- Tizen
</code></pre>
Maybe like it's on flutter docs: <a href="https://docs.flutter.dev/reference/supported-platforms" rel="nofollow">https://docs.flutter.dev/reference/supported-platforms</a>
If only I had known about this (or judging by commit history, if it existed) ~3 weeks ago. I've been saying for ages that either React ported to Go or a React-like framework for Go would be an incredible development experience, so this looks perfect (I used to be a big hater of React.js until I was enlightened by React.lua).
Main problem is that when you release on desktop, a web version is usually desirable (except for very niche apps that interact a lot with the OS).<p>Alternatively, something that targets many platforms, including mobile.<p>I've been searching for something for quite a while and the closest is qt and react native, both painful choices for various reasons
> runtime.LockOSThread()<p>> <a href="https://github.com/roblillack/spot/blob/main/ui/init_fltk.go#L23">https://github.com/roblillack/spot/blob/main/ui/init_fltk.go...</a><p>Does this imply GOMAXPROCS needs to be set to at least 2?
Cool!<p>What does building for cross platform look like? Would love if there was a command that produced my MacOs .app and Windows exe without me having to dive into package management/containers/signing headaches per platform.
This looks really cool but a bit incomplete and messy without XML-like syntax sugar for composing component functions. Is it even possible to extend Go like the JSX?
Been using<p><a href="https://fyne.io/" rel="nofollow">https://fyne.io/</a><p><a href="https://github.com/fyne-io/fyne">https://github.com/fyne-io/fyne</a><p>for years but will check this out<p>(
terminal but still great go guis:<p><a href="https://github.com/gizak/termui">https://github.com/gizak/termui</a><p><a href="https://github.com/charmbracelet/bubbletea">https://github.com/charmbracelet/bubbletea</a>
)<p>Never used but should be in this list:<p><a href="https://gioui.org/" rel="nofollow">https://gioui.org/</a><p><a href="https://mattn.github.io/go-gtk/" rel="nofollow">https://mattn.github.io/go-gtk/</a><p><a href="https://github.com/lxn/walk">https://github.com/lxn/walk</a>
I don't know how to take this in. On one side, it's great to have a cross-platform GUI toolkit that's easy to use; on the other side, it feels like a React-like UI is contrary to the spirit of simplicity and resource efficiency of Go.<p>I'm sure it has its perfect use cases, though.