I've had decent experiences with Python and Qt5. Windows was historically the painful part, but FBS¹ makes that a lot less painful nowadays. Tk also works reasonably well if you don't need the features and native integration that Qt offers (and I'm pretty sure FBS can handle Tkinter apps just fine). The .NET ecosystem is another solid choice for cross-platform desktop app development (and nowadays even mobile, too).…
Ask HN: How do you create a cross-platform GUI without using Electron?
91–100 of 112 posts
Re: Ask HN: How do you create a cross-platform GUI without using Electron?
#92Electron: Bloat, non-native, highly questionable language
Other cross-platform solutions: Obscure, (most often) non-native, undesirable language constraints, often far behind with regards to UI paradigms
Native UI for each platform with common code: requires deep knowledge of each platform, probably more time consuming than the other alternatives, the seam between common code and platform-specific code is often a source of errors
Fully separated native applications: Likely to produce the highest quality UIs, but requires the most diverse knowledge and time, more difficult to remain consistent across implementations, team size becomes an issue depending on how many platforms are supported
As much as I dislike Electron-applications, it's understandable why they became adopted so widely - the alternatives are just quite simply not great.
Re: Ask HN: How do you create a cross-platform GUI without using Electron?
#93It worked but the amount of effort is not worth it for most organisations.
Re: Ask HN: How do you create a cross-platform GUI without using Electron?
#94One word: Lazarus. Cross platform done right (native code, no intepreter, no VM). Both IDE and generated code run native just about everywhere, from small ARM boards to virtual machines, and of course x86. As fast as C, decent sized executables, lots of built in or available libraries and components to do a lot of things, from managing databases to low level access to hardware, graphics, sound, etc. And of course it'…
They don't integrate Qt widgets or other frameworks properly.
Re: Ask HN: How do you create a cross-platform GUI without using Electron?
#95There's a decent GUI markup editor (Scene Builder). There's no need to manually connect your handlers from XML markup to code - you can use annotations for that. There's HiDPI scaling that you can override if need be. There are Observable properties that you can bind to each other.
It's nice! Canvas and DrawingContext are a bit of a pain to use for my specific use-case, since it draws straight to buffer with no underlying Image, but I make do for now.
And you can take advantage of jlink to trim your JDK to modest sizes. There are also tools like Graal Native and Liberica Native Image Kit to compile your Java app down to binary, but I haven't toyed with those yet.
The cons are obvious: non-native look (you can try to style it with CSS, but there are no ready-made native looking solutions, I think, only different themes) and JVM startup time.
However, if you're willing to write C++, I'd argue Qt is the best choice right now. I just refuse to touch C/C++ with a ten-foot pole
Re: Ask HN: How do you create a cross-platform GUI without using Electron?
#96Re: Ask HN: How do you create a cross-platform GUI without using Electron?
#97In Solvespace we use native GUI on Windows, MacOS, and Linux (GTK). This is probably not what you want to do, as we don't use any GUI widgets - only popup dialogs and menus. Everything in the app itself is rendered using OpenGL. Even our "text window" is drawn using OpenGL and GNU unifont (this is something that really needs to change BTW). The platform abstraction code is here: https://github.com/solvespace/solvespa…
Re: Ask HN: How do you create a cross-platform GUI without using Electron?
#98We write apps like this in Object Pascal using Lazarus. Think Delphi but open source. We have a suite of framework-specific developer apps for tasks like packaging deployments, managing common database tasks, onboarding new clients etc. They were written on Linux using Lazarus, then recompiled on MacOS and Windows as required. There are occasionally OS-specific variations for small pieces of these apps, but Object Pa…
Cool! May I ask what project you’re working on?
Re: Ask HN: How do you create a cross-platform GUI without using Electron?
#99One word: Lazarus. Cross platform done right (native code, no intepreter, no VM). Both IDE and generated code run native just about everywhere, from small ARM boards to virtual machines, and of course x86. As fast as C, decent sized executables, lots of built in or available libraries and components to do a lot of things, from managing databases to low level access to hardware, graphics, sound, etc. And of course it'…
What's the Lazarus experience like for cross-compiling to other platforms? E.G. how hard is it to build a working result for Windows, OSX and Linux (maybe BSD) from Linux or BSD?
Re: Ask HN: How do you create a cross-platform GUI without using Electron?
#100Earlier quoted context omitted.
I second this choice. It is the only toolkit that looks native in Windows. And it is ridiculously fast compared to alternatives.
I'm currently writing a cross-platform toolkit, and I'd like to know what native looks like in Windows. As far as I can tell it's worse than Linux. You have the old Win32 / MFC style widgets, and programs like Notepad++ that use something that looks similar. There's the style that much (but not all) of the Control Panel seems to use (is the name Metro?), but the only application that I've used that uses anything simi…
That's the one. Everything else has never gained enough traction.