Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Anyone with experience developing cross-platform native code, what's your take on the state of native cross-platform? Comment on GTK, qt?


People forget that most apps start off as a dozen lines to solve someone's individual problem.

Qt is nice. GTK is... ok. But to get a cross-platform build with either of them requires a couple of hours' fiddling around. The later you wait to go cross-platform, the more platform-specific assumptions creep into your code and the longer it'll take. But no-one wants to spend that couple of hours fiddling around right at the start of their project, when it's just a dozen lines to fix their own problem.

With electron you write that dozen line helper utility and you're automatically cross-platform from day 1. And not just in the kind of theoretical way you get with say PyQt where your application could be made to build on another platform if you spent a couple of hours fiddling with the build; the alternate-platform binaries are just there. That's powerful.


I'm not a big fan of the Web stack, but I think if for whatever reason I had to write an offline app with a web-ish frontend, I'd write a cross-platform HTTP local-server and use the regular browser. I'm biased towards Electron, because I use underpowered systems and just one modern browser is a big resource hog, but one per application is nuts on a low-power system.


> I'd write a cross-platform HTTP local-server and use the regular browser.

That doesn't actually solve the biggest problem. How do you package up that server? Can you make it something people can run like a regular executable on that platform? How do you distribute it?


Right, it doesn't address that at all. Browser's have minimal support for local cross-browser apps.

The fact that you can't easily piggyback on the local browser irks me somewhat. If it's inherently a behemoth, maybe have it be reusable, i.e. piggyback friendly. You wouldn't want a per-app installation of Qt, for example, but even that would be less stressful on the system.

I have a lot of fantasies about how the web stack could be different. I guess that's reflective of some kind of frustration.


For many apps I'd ask if it really needs to be local. I've had some success with compiling my application to a pile of javascript and then it's possible to go from there to "works offline" functionality, at which point you have a de facto local application that just happens to be opened by putting a particular URL in the browser.


I wasn't aware that that kind of offline web app was possible. I'm surprised there aren't more of them.

My impression was that with an offline capable web app you need CDNs et al to be reachable to load the web app, and then if connection was lost the app could handle it, but if you were to close and reopen the app, it would again need an internet connection to load.


as Microsoft moves to embed blink into windows, wouldnt it make sense for a stripped down version of Electron that calls the OS libraries, instead of embedding their own. I can see Microsoft moving that way for its apps.


I'm partial to GTK (it's just C and doesn't need a special pre-processor) but Qt does a much better job of looking decent on non-linux computers. There's probably some other options worth considering like libUI and Tk.


As long as you target desktop class apps, Qt is more than enough. For native mobile the offer is weaker (in Qt land, is QML) but possible. For web development Qt is not an option.

Electron can target web/desktop/mobile but the results are far from optimal (RAM, CPU cycles... JS!).


Extending this question a bit, a framework I'm curious about is JavaFX. A modern GUI toolkit targeting the JVM sounds like something that could rival Electron, especially if they manage to get installation right (would probably involve embedding the JVM). One would be able to write cross-platform desktop apps in Kotlin or Clojure for example. But I don't see a lot of people using it, or even mentioning it at all...


The JVM is a heavy runtime, though lighter than Chromium. On second thought, apart from the slow startup, I don't really have experience with JVM desktop-side.

I'm wondering if we might see more of JVM on desktops when the new low-latency GC engines become usable.


Qt, wxWidgets, Gtk(mm) - I'll take such framework even if I want to develop for a single platform - the sane APIs and you can always fallback to '#ifdef platform' as needed (rare).


Qt is ok. Not great, but serviceable.

Everything else is worse.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: