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

Genuinely curious, what can be used instead of Electron for cross-platform desktop app?


Tk - It can look a bit dated, but it's easy to use, comes bundled with Python or Tcl, and bindings in most popular languages. Can run on Windows, Linux, macOS.

Qt - The IDE is great. It doesn't look native. Either dynamically linked, or commercially licensed. Runs on Windows, Mac OS X, Linux, Android, iOS, and a range of embedded hardware.

wxWidgets - Native backends, so it always looks like it belongs. Bindings in a ton of languages. Can be both simple or complex, depending on what you need it to do. Runs on Windows, Mac OS X, Linux, and in-progress for Android and iOS.

JavaFX - Java's replacement for Spring. Runs anywhere Java does. Fairly flexible, and easy to use.

Kivy - A Python framework. Mainly aimed at touch-compatibility. Runs on Windows, Linux, macOS, iOS, and Android.

LCL - A Lazarus framework. (Think Pascal). Really easy to use, with great drag'n'drop and the like in the IDE. Runs on Windows, macOS and Linux.

nuklear - Fairly easy to use, with bindings in a lot of languages. Sometimes requires a bit more work getting it to run on some platforms.

This is not all, but the ones I find easy to use (as easy or easier than Electron), and easy to set up and deploy.


Thanks for such a detailed answer. Can you elaborate why those would be better than Electron?


It depends on what you want from the framework.

Electron doesn't look native, which a lot of consumers don't like. Others don't care. So, depending on your audience, it can be an extra hurdle that some like wxWidgets don't have.

Electron is difficult to get performant. You need to really think and test your perf. Qt, Tk, and a few of the others are much faster, much easier. And if you put in the same effort you need to put in for a fast Electron program, you can end up with blisteringly fast speeds.

Electron bundles are large to download. Some places this doesn't matter, others it does. (Think Australia, Africa and the like where tiny download caps exist). IIRC Qt, the biggest dependency, is about half the size of Electron. Tk and wxWidget are small, nuklear is just a header. It's tiny.

Electron is not good with touchscreens (or "harder to get right"), but more and more people have them. Kivy is great for that usecase.

Electron is "just code". Qt Creator and Lazarus' IDE are phenomenal for putting GUIs together. You'll be surprised how little code you need.

Electron is primarily JavaScript. Some people like that, others don't. If you want an easy language, you can use Python, or Nim. Want more control C or C++. Value both time and control? Go with Java.

Electron has its place.

If you have a really tight time-to-market window, or this is just a tiny personal project, and JavaScript is your "goto" language, then awesome. Use it.

But, the cross-platform GUI world is big. You have a dozen or so mature, stable, proven frameworks.

So if your project takes off, or you have the time to do things right, evaluate if any of these libraries, including Electron, fit your needs.


How's Java giving user more control than Nim? The latter allows for hardware access like C/C++


I said C/++ was more control, Java was a middleground between the two. Nim is easier, but its memory usage and performance are harder to be sure about, because it hasn't been around as long.


With Java you can get it through JNI.

But if you're going that route, you'll be making your life a lot harder in the cross-platform department.


Other people have mentioned Qt, which is great, but I'd like to point out there it also support QML which is probably better your you.

* It is backed by Qt and rendered by OpenGL, so it performs very well.

* It has very easy syntax, especially automatic variable binding, so there is very little boilerplate for event handingl.

* It supports JavaScript. You can code the logic in either JS or C++, depending on whether you need the performance or not, and it can be easily split between the two.

* They actually support two sets of pre-made controls, one that looks like desktop UI (http://doc.qt.io/qt-5/qtquickcontrols-index.html) and one that looks like Android or iOS (https://doc.qt.io/qt-5/qtquickcontrols2-index.html). Or you can design your own UI from rectangles and other shape. Or combine all three.


Qt is an option. Supported on Windows, Mac, and Linux.


Tk is crossplatform, free and open source: https://en.wikipedia.org/wiki/Tk_(software)

It might look a bit dated on some platforms, but it will be lean and fast, unlike Electron.


I can understand the appeal of writing a non-internet app that uses html/css/javascript. But if you want to do that, why not just run a server locally and use a normal web page? Seems better than running a custom chrome instance.


A bit old-school, but many use JavaFX, especially for enterprise apps, even if people on HN may bash on Java for whatever reason.


"Many" is untrue. I'm a huge Java fan but FX never picked: https://www.codenameone.com/blog/should-oracle-spring-clean-...

Enterprises still use Swing and some have touched FX as Swing is in maintenance mode and they don't have a choice.




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

Search: