Live data from Hacker News

Build desktop applications using Go and Web Technologies

github.com

61–70 of 82 posts

Re: Build desktop applications using Go and Web Technologies

#61
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.

Very interesting! How would the Electron and Go processes communicate in this case? Did you expose a Unix socket or TCP port perhaps?

Re: Build desktop applications using Go and Web Technologies

#62
post #52

Earlier quoted context omitted.

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/

But we want the web into the desktop, not the desktop into the web.

Re: Build desktop applications using Go and Web Technologies

#64
post #52

Earlier quoted context omitted.

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/

That is both .NET stuff, Wails is one of various Go options.

Re: Build desktop applications using Go and Web Technologies

#66
post #13

I really enjoyed building small apps with wails. Even though people would prefer that we all used native UI frameworks, the DX is simply incomparable to that of web technologies. And for most apps using browser based rendering won't be an issue. People often underestimate how optimized mondern browsers really are. And because Chromium is not shipped the bundle size is managable. Not wanting to use JS on the backend I…

Electron is quite bad on memory usage because it carries its own v8 environment on top of its own browser platform on top of using _another_ v8 environment for the nodejs part.

Tauri and Wails just use the one available in the OS (UIWebKit in macos, WebView2 in windows), it is also why they load so fast, you probably already have the heavy part loaded in memory. And, of course, brings a tiny statically linked binary instead of running on top of a massive runtime.

Re: Build desktop applications using Go and Web Technologies

#67
post #23

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

You might find this appealing: https://github.com/mappu/miqt

Came here to say this. I just started with miqt and it seems to work really well. Go + Qt is near ideal.

Re: Build desktop applications using Go and Web Technologies

#69

Earlier quoted context omitted.

There are quite a few. Qt, React Native, Xamarin, and Flutter come to mind.

Those are not native (on desktop) in any sense of the word. They don't use native controls. For that, you want WX or SWT, but those come with their own sets of problems. On Windows, it's not even obvious what native is any more, even Microsoft just uses Web views. Mac is a bit better, but there are still 4 UI libraries to choose from (AppKit, UIKit through Catalyst, native SwiftUI and Catalyst SwiftUI). I'm personall…

Native is what comes from the platform vendor, secondly anything using native graphics APIs to render instead of shipping a browser on top.

Web is only native on ChromeOS and WebOS, because they don't have anything else as UI technology.

Re: Build desktop applications using Go and Web Technologies

#70

Earlier quoted context omitted.

I am working on the UI library and bindings for Go. Still not finished, but currently, the same app can be compiled for Win32, Cocoa, GTK2, GTK3, GTK4, Qt5, Qt6, and Motif. There is a web browser control, a GL canvas, and a regular canvas. I still work on the native table control, though. https://github.com/gen2brain/iup-go

Does IUP have a table control? I looked at the IUP website and didn't see one.

Treeviews are where the rubber meets the road, IMHO.
Post reply on HN