Live data from Hacker News

Build desktop applications using Go and Web Technologies

github.com

51–60 of 82 posts

Re: Build desktop applications using Go and Web Technologies

#51
post #26

We built a background daemon as a macOS menu bar app in Go, and the performance was surprisingly bad. The Go bindings for native UI frameworks ended up being massive RAM hogs. When we profiled it, we found that the GC essentially gave up under load, which explained why customers were reporting a simple menu bar app consuming 2.5GB+ of RAM on their Macs. We eventually abandoned the Go approach and switched to Electron…

I actually did something similar: business logic and most things written in Go, but the menu bar or tray icon done in native APIs like Win32 and Gtk. It was surprisingly very good experience overall. I have tried so many ways around it before settling for that.

Re: Build desktop applications using Go and Web Technologies

#52

The lengths we will go to avoid writing a proper desktop application.

because there is no proper UI library that does cross platform as well as the web

These two are good:

https://avaloniaui.net/

https://platform.uno/

Re: Build desktop applications using Go and Web Technologies

#54
post #43

Earlier quoted context omitted.

> When we profiled it, we found that the GC essentially gave up under load Hmm, the Go GC is really quite capable, so I wonder what kind of pathological load it was being presented with. Even then, when the GC "fails" it means elevated CPU load from collection. The main thing I can think of would be the application "leaking" by having unintentional references (or worse, actually leaking through cgo bindings), or tras…

I totally agree :) I don't blame Go either. We were already a pure Go shop with a lot of focus on backend and infra systems engineering and were trying to venture into the desktop app market for our device monitoring software. Once we validated our idea with a rather buggy MVP haha, we quickly switched over to Electron and deployed on all 3 desktop OSes properly.

[dead]

Re: Build desktop applications using Go and Web Technologies

#56
post #39

Have a look at Fyne as well [0], which is a Go-only native UI toolkit. 0 - https://fyne.io Other discussions: - https://news.ycombinator.com/item?id=31785556 - https://news.ycombinator.com/item?id=19478079 - https://news.ycombinator.com/item?id=22291150

I did a project a few years ago with Fyne and it was excellent.

Re: Build desktop applications using Go and Web Technologies

#57

The lengths we will go to avoid writing a proper desktop application.

Fyne is a pretty decent native solution for doing this in Go.

It's fast, quick, and easy, but it's peak programmer UI. It's pretty unattractive, does not integrate well with its host OS (in terms of behavior), and does not integrate at all with accessibility tools.

At least last I looked into it.

Re: Build desktop applications using Go and Web Technologies

#58
post #14

Earlier quoted context omitted.

I wouldn't exactly call Flutter native. It uses its own rendering engine and doesn't necessarily behave like operating system native controls. It is not really different from using electron.

What are the Linux native controls? GTK and KDE controls are native to GTK and KDE.

Sure, but GTK and KDE aren't also cross-platform native.

Re: Build desktop applications using Go and Web Technologies

#59
post #25

Earlier quoted context omitted.

Making good GUI software requires a lot of iteration and trial and error before you're satisfied with the UI and UX. With a web-based tech, you make a change, auto reload triggers, you see the change almost instantly, making tweaking very easy. If you're working with a large Qt codebase, every little change to a header file requires a long ass compile times. It's really frustrating when you spend an hour just tweakin…

It takes half a day to implement proper hot reload in QtQuick, which also has all the reactive features. Even less now that AI can just write it for you, and it’ll be more performant than Vite dev builds. Coming to desktop app development from the web, I’ve got most of the same conveniences I’m used to like GammaRay as the inspector. The only real difference is I’m willing to wade through cmake and linking errors. Ev…

QML is not native, PySide uses Python. If you pick either of those, you lose native controls and low level language for performance, so again, may as well use web-based tech. Especially that HTML/CSS support significantly more styling/animating options than QML.

Re: Build desktop applications using Go and Web Technologies

#60
post #26

We built a background daemon as a macOS menu bar app in Go, and the performance was surprisingly bad. The Go bindings for native UI frameworks ended up being massive RAM hogs. When we profiled it, we found that the GC essentially gave up under load, which explained why customers were reporting a simple menu bar app consuming 2.5GB+ of RAM on their Macs. We eventually abandoned the Go approach and switched to Electron…

That is a surprising use case about Go and Electron (!), I would have imagined no contest for the superior performance of a compiled language, even with garbage collection. But the mention of "bindings for native UI frameworks", it was probably running the compiled code in a very tight loop, stressing the runtime. In contrast, Chromium specializes in UI with years of optimization. Recently for a specific purpose I wa…

[deleted]
Post reply on HN