Live data from Hacker News

Ask HN: How do you create a cross-platform GUI without using Electron?

news.ycombinator.com

11–20 of 112 posts

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#11
post #7

There are several options, each with their own pros and cons. Qt [1] The main codebase is C++, but bindings are available for Python and several other languages. I have developed and shipped multiple cross-platorm applications using Qt, using both C++ and Python. Documentation and source code examples are readily available. JUCE [2] Another C++ framework, with Python bindings. The focus is on music and audio apps, bu…

If you have access to Python 3.5 or 3.6, you can use my open source library https://build-system.fman.io to create a Python / Qt app with an installer for all the OSs in minutes. Python 3.7-3.9 is also supported, but only available commercially.

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#13
It would be really nice if there was a shared widget API that would work for the major operating systems. If most of simple app could work on Windows, OSX, maybe mobile (Android / iOS) and Linux / BSD.

Something that was mostly native for all of them.

Currently the only alternative to Electron that is similar is a program that hosts a local webserver and the local browser is pointed at it, but that's a second class experience.

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#16
I'm not the best person to explain or recommend it, but I'll suggest "immediate mode" GUIs partially because I want to hear more about the pros/cons from those more experienced (I haven't ever worked on UIs professionally). It seems these graphics libraries just need some kind of context to draw to, like from OpenGL, and also have a simpler implementation in general. That might make them more portable and smaller, if less native-feeling. I just started looking into egui (a Rust crate) myself.

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#17
post #9

I'll get shot for suggesting this most places, but I feel like GTK has the most 'native' feel across every operating system. That's not to say that it's easy to get working (setting up proper build targets is going to be your biggest hurdle), but your reward is a stylish and robust UI with proper touchscreen support on Windows/Linux.

I personally think the exact opposite. GTK needs a lot of custom styling to get the "native" style to work, and even then it's kind of lacking.

GTK feels right at home in the GNOME desktop environment (which I use, and like!) but for cross platform I don't really think it feels native at all. As a user, I've had much better native experiences with QT or WxWidgets to be honest (on Windows, at least).

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#18
https://tauri.studio/ - I haven’t used it myself but looks pretty interesting. They say they use existing browser engine shipped with OS and desktop integration layer written in Rust. The claim is that you get an application size under 1MB

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#19
You probably are wasting your time - multi-billion dollar companies have abandoned native desktop development - pretty sure they decided it was just easier and cheaper to maintain. If you are doing this for fun or profit - you need to decide how much your time is worth.

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#20
There is also an interesting solution to this problem: use native WebView, so you don't have to pack the whole Chrome with your app. Basically every "electron alternative" with HTML+CSS+JS works this way.

https://github.com/sudhakar3697/electron-alternatives

Post reply on HN