Hacker News new | ask | show | jobs
by robochat 1868 days ago
In general, developing gui is still too hard with too many trade-offs. Qt is so very large and requires C++ knowledge; or you can develop in python but python applications are hard to distribute. For other languages, the library bindings are often unmaintained because it is a lot of work or there are multiple choices and it is hard to know which one to use. QML is interesting but I tried to develop a csv viewer with it and found it didn't have all of the widgets that Qtwidgets has.

There are lots of other options, almost too many: Electron apps are good for web developers but they are also inefficient and use more memory than I think is necessary. Pascal and Lazarus seems useful but I don't really want to learn Pascal as it's not a popular language now. Vala could have been good but it seems to have lost momentum. There's Swift but it still seems to be mostly an IOS thing. There are also wxwidgets, gtk, fltk, ... None seem to really convince me that they make gui development straight forward.

Many other languages never really have the manpower to develop gui libraries or even polish their bindings to libraries like Qt and GTK, or there'll be 3 or 4 choices that are all half finished. What would be nice, would be to be able to easily develop gui in a modern compiled language that creates compact executables for distribution that look good on the linux desktop. I'm thinking about languages like go, rust or nim.

1 comments

I like what Syncthing are doing: They just pop open a web browser window for the UI. It's like making an Electron app, except without having to ship an entire browser with your app. I have no idea why it's not more common.
Because that way you as a dev have zero control over the browser used, which can cause a variety of issues ( e.g. IE or Safari or an obsolete version of X being used, a browser extension causing problems) and an "app" has some advantages ( can run in background, can have toolbar icon, can be launched on startup, etc.)
> can run in background,

Syncthing runs fine in the background.

> can be launched on startup,

You can launch an app on startup regardless of what GUI toolkit it's using, or whether it's using one at all. Are you saying that you can only run a program at startup if it's using Electron?

> can have toolbar icon,

I think there's a misunderstanding here. I was talking about using the browser for the GUI of your app via an embedded HTTP-server, like Syncthing does; not replacing your entire program with a HTML-document with some JavaScript, which would clearly have some limitations.

> you as a dev have zero control over the browser used,

Well, that's also not true. You can check that the browser uses a certain user agent string, or you can add a specific version of a specific browser as a package dependency.

This is what I do for my home-grown apps. I write as much as I can in JS, and then provide a localhost API to access native operations like notifications or file management. I have one always-on background server that lets me execute arbitrary SQL on one SQLite file and use that as a shared database between all of my small apps and it works great.
Yeah if it absolutely has to be web-driven, I prefer to use my own browser and just have it as a pinned tab in Firefox. That way I can leverage its privacy protection too.