
Ask HN: What would you use to make cross-platform desktop application? - shubhamjain
Seeing Electron as an unpopular choice here for making Desktop applications (size-heavy, and slow), I am interested what all options exist to make cross platform apps.
======
seanwilson
I would take opinions on here from developers with a big grain of salt. I read
people saying things like Spotify and Atom are "unusable" and slow because
they're written in JavaScript when they have plenty of happy users.

A few 100MB of RAM or disk space extra is a nonexistent issue as well to
typical users. I know some developers get very offended at a program using a
bit more RAM or CPU than it should be but developer efficiency is more
important most of the time so it's a completely rational trade-off. Some of
these apps wouldn't exist at all if everyone insisted on native everywhere.

It's all just my opinion as well, but approaches like Electron are very
efficient at creating good cross platform apps. Developing and maintaining
several native apps is a huge resource drain when most users aren't going to
care.

~~~
old-gregg
Every Electron app I tried halved my battery life. Sure, regular people won't
complain about your electron "desktop" app, they'll just complain about crappy
batteries of their laptop, or about "my computer getting slow".

In fact, every time you hear a non-programmer complain about their computer
it's usually not a hardware, but a software like electron that's ruining their
experience.

OSes have started to add application profiling recently, so once every
mainstream OS starts loudly pointing a finger at offensive applications (like
"uninstall Spotify/Slack and you'll get 4 more hours of battery life"), you'll
start hearing complaints from non-programmers.

~~~
jones1618
I'm not sure about battery life but I was a huge fan of Slack (based on
Electron) until I set it to run at startup. Before then I'd routinely have
three Visual Studio instances, a SQL manager and Chrome running with 10 or 15
tabs open. No problem. Suddenly, I noticed my Windows machine would bog down
with just one Visual Studio and take minutes to load Chrome. I was sure I had
a virus.

Actually, Task Manager showed 90% of my 8Gb ram being utilized and caching to
disk constantly with most of the ram and CPU being hogged by eight(!) Slack
threads. This is with Slack minimized and sitting idle.

The fix was to replace the Slack/Electron app and use the browser version
instead. That solved it.

Electron is a super cool piece of tech that could enable all kinds of great
app development but needs to go on a serious diet first.

------
irishcoffee
Obligatory: Qt.

I've been tasked as a Qt dev at my day job for the past ~2.5 years writing
cross-platform applications. It works, the documentation is pretty fantastic,
and you'll find no shortage of help online to get over the admittedly decent
learning curve if this is your first swing at "c++" programming.

Edit: As mentioned below, PyQt is also pretty fantastic. My most recent
venture into the PyQt world at work was writing a touchscreen application on a
800x450 touchscreen, and it all "just worked."

~~~
ThePhysicist
Seconded:

\- QT is a great and very-well designed library with solid performance, a fast
release cycle and superb documentation.

\- It provides a rich and well thought-out component library.

\- It is used by many companies to build real-world applications.

\- It has a pretty liberal licensing scheme. The commercial license (if you
need it) is not that expensive.

\- It provides bindings for many scripting languages like Python.

\- It has great IDE support and lots of tooling around the core library that
make GUI design easier.

\- It emabraces model-driven design and has stylable components (via CSS).

\- It will usually beat most JS / WebKit based frameworks by a large margin
performance-wise and makes distribution of your application much easier
(forget about >100 MB downloads).

~~~
chacham15
FWIW its version of CSS is just terrible, there are a lot of properties you
cannot control with it (e.g. display properties), its style inheritance model
is equally terrible (for some reason if you do .foo, the foo object will get
the style as will all of foo's children), and forget about animations. To be
fair, I did test it out at v5 and they may have improved it, but at that time
it was by no means a fair thing to call it css.

~~~
blub
And that's why they call it QSS (Qt style sheets). :)

------
open-source-ux
Lazarus is a cross-platform IDE for native desktop applications on Windows,
Mac and Linux. It produces fast, low-memory, single executable files for easy
installation and deployment. Your app can use native OS controls - you won't
be gluing together different libraries from different languages like you do
with some scripting languages (with all the bloated size and performance
issues that entails).

Why isn't it more popular? Because it's written in FreePascal: a modern,
object-oriented version of Pascal. A lot of readers will stop right here and
never this give project another glance, the thought of using Pascal as simply
too outdated or embarrassing.

If you do give it a try, you'll discover one of the best and most overlooked
options for native desktop app development. Any downsides? A major one in my
view: poor and patchy documentation (which will be a barrier and block for
many).

[https://www.lazarus-ide.org/](https://www.lazarus-ide.org/)

~~~
nkkollaw
Why FreePascal..?

This is suicide.

~~~
jonathonf
Something a little less hyperbolic might be better, e.g. what specifically is
wrong with FreePascal?

~~~
nkkollaw
The fact that the project is not popular because of the language it's written
with..?

~~~
jonathonf
Why is FreePascal unpopular (or what makes you say that)?

Is it lack of mindshare, lack of "hotness", some specific deficiency, or... ?

~~~
nkkollaw
I just read what the comment said:

> Why isn't it more popular? Because it's written in FreePascal: a modern,
> object-oriented version of Pascal. A lot of readers will stop right here and
> never this give project another glance, the thought of using Pascal as
> simply too outdated or embarrassing.

Personally, I've never heard of the framework and FreePascal would definitely
be a reason not to adopt it for me, as I'm not familiar with how to fix
problems should they arise, while I would be able to troubleshoot an app
written on Java or better yet NodeJS.

------
mherrmann
I'm developing a file manager [1] and asked myself the exact same question a
year ago. I chose PyQt and am quite happy with it. I wrote a blog post [2]
back then about your very question. If you pick PyQt, then you will also find
several other articles on the blog [3] interesting. Basically, whenever I
encountered a hurdle, I posted a solution.

[1]: [https://fman.io](https://fman.io)

[2]: [https://fman.io/blog/picking-technologies-for-a-desktop-
app-...](https://fman.io/blog/picking-technologies-for-a-desktop-app-in-2016/)

[3]: [https://fman.io/blog](https://fman.io/blog)

------
sktrdie
Why not just have a daemon process that runs a site on HTTP or WebSocket so
you can use the app in your browser?

I've seen apps that run with a double-click, stay open, and open my browser
tab on 127.0.0.1:43110, with the entire app right there. It takes very little
to develop, and it's lightweight because it's already using a runtime we all
use most of the time (a web browser).

For the development side, this is pretty much the same experience as
developing for Electron, but without the RAM/battery drainage.

~~~
laumars
I've often said that if I wanted to run a desktop application in a web
browser, then I would prefer to run it in an actual web browser and thus share
the framework footprint rather than running multiple instances of Electron.

------
gkya
Emacs.

I mean the user base and the scope is kind-of limited, but it's really easy to
build thin-clients and some certain types of applications in Elisp. And
against all prejudice, modern Elisp is quite a pleasurable language to write
in. Furthermore, it's a joy to use that sort of "apps" in emacs and the
community really likes it when those pop up. Also, there already are rather
featureful apps like Gnus, Magit, EMMS and Elfeed, and the user is allowed
vast customisation even without you really thinking about allowing it
(advices, monkey-patching, keybindings, hooks, etc.).

P.S.: While I don't suggest this as seriously as those who suggest Qt and
WxWidgets et al., if your demographic is hackers, you can consider it.

------
nkkollaw
Who cares if Electron is unpopular (is it?)?

I use Electron apps daily: Atom, Spotify, and Wmail, and I'm perfectly
productive with them.

Atom is definitely slower than Sublime Text, but I'm not sure it's Electron's
fault (I read that it isn't). As for Spotify and Wmail, you can't even tell
it's Electron, and certainly no average user cares or would ever know.

I would do what makes sense for your app and makes it easier to port it.
Electron works great for that, and you can use the same code to offer a web
app.

~~~
dopamean
Electron certainly isn't unpopular with the people who use applications built
with Electron.

~~~
nkkollaw
I doubt more than 95% of those who have Spotify install know what Electron is.

------
nurettin
We use delphi at work. It is suited to building in-house apps iOS, Android and
Windows, as well as web services on Linux.

~~~
candiodari
What version of Delphi are you using ?

Don't you find the lack of 3rd party library support somewhat difficult ?

~~~
nurettin
We have legacy software written in Delphi7 as well as newer web facing
utilities and android applications (for customs and logistics personnel)
written in Delphi XE7 and later.

We get excellent third party support for oxml, secure blackbox, gnostice
components, devexpress components, uniqui and many, many other libraries.

~~~
candiodari
Great to hear that all of it is still alive. I was getting out my old Delphi I
so enjoyed in high school but I found that while all my programs do still work
on win10, the same cannot be said of the IDE (although Delphi 1 does work).

So I had to put it in virtualbox in windows xp. Great nostalgic experience I
must say. Back when I truly enjoyed programming just for the sake of trying
something new.

~~~
nurettin
There is a free version of XE 10.2 that works on windows 10 with a lot of the
features cut. You can still write 32bit windows applications just like the old
days:
[https://www.embarcadero.com/products/delphi/starter/promotio...](https://www.embarcadero.com/products/delphi/starter/promotional-
download)

~~~
vram22
Seems like they are naming the versions after cities nowadays (maybe were
earlier too). E.g. 10, 10.1 and 10.2 are called Seattle, Berlin and Tokyo. Had
tried out 10 Seattle and am using 10.1 Berlin some.

------
joewood1972
I think it depends on the type of application, and how much code you want to
reuse. Assuming this a fairly large scale app and long term maintainability is
a consideration:

* If some of the code is likely to be reused with an associated website I would go for Electron. Using ReactJS.

* If an associated mobile app is also possible, I would take a look at React-Native, which have some embryonic desktop technology counterparts. This option can be combined with a webview.

* Worth also looking at Xamarin, especially if there's existing investment and skills in .NET (e.g. existing Windows app being migrated).

------
johnfn
Electron hasn't stopped Spotify from making the most widely used music client
and VSCode from making the third most popular IDE.

~~~
gkya
I'd audaciously guess that it's the songs you play in it that makes the
spotify app popular, not the pack of ones and zeroes that the developers
thereof like better.

~~~
johnfn
Ever hear of the Napster audio app? Not the p2p thing, the paid subscription
app? It was just like Spotify, way before Spotify? Oh really, no, you hadn't?
Could it be because the UI was terrible? Hm.

What about rdio? Back in the day, I remember noticing they had a much better
music archive than Spotify in some areas like prog. Still, I never made the
switch. (The way they organized music was terrible.) Apparently, neither did
anyone else.

I could go on. All these Spotify competitors, all with decent libraries. How
did Spotify end up winning?

I'm not saying that songs are unimportant, but if you have trash ux people are
going to find an alternative.

~~~
gkya
So not electron = trash UX?

(edit: I'm an amateur musician, I do know quite a bit about the online music
sphere, and I've been a paid user of both Deezer and Spotify in the past. You
usually don't know who you're talking to on the internet, so better don't
assume things.)

~~~
johnfn
Did I make assumptions? My bad. Well, I guess I made the assumption that you
were unfamiliar with the napster app, so my bad. Other that that I dunno. (I
happen to be an amateur musician as well. Fun coincidence.)

Anyways, what I'm saying is that using electron is not really correlated to
"bad app" and not using electron is not correlated to "good app".

------
mingodad
FLTK [http://www.fltk.org/index.php](http://www.fltk.org/index.php) dead easy
and uncomplicated, an http server for business logic.

Also I use then through a scripting language
[https://github.com/mingodad/squilu](https://github.com/mingodad/squilu) OS X,
Linux, Windows, (iOS && Android through browser/native) ...

------
SyneRyder
Maybe consider Xojo, which is like a cross-platform Visual Basic. I know, that
means you're programming in Basic, but it's the fastest tool I've found & the
compiled binaries are relatively small (Mac version of my current app is 11 MB
uncompressed). It supports Mac / Windows / Linux, but it also compiles to
Raspberry Pi, iOS, Web, and Android support is in the works. Pricing is
cheaper than Delphi or Qt. But if you need to collaborate, there aren't as
many Xojo / REALbasic developers out there, as something like Qt:

[http://www.xojo.com/](http://www.xojo.com/)

For other Windows/Mac stuff I'm working on, I use C++ for the cross-platform
code, and Win32 API / Obj-C for the platform-specific interface layers.

------
kevinherron
JavaFX looks pretty good right now... especially if you use Kotlin and
TornadoFX with it.

------
jhasse
wxWidgets. More lightweight than Qt and better looking on Linux. It has
improved quite a lot recently, for example it supported binding C++11 lambda
functions to signals before Qt.

Also: No moc compiler and you can statically link it without paying for a
commercial license.

------
sealord
Have you checked out [NW.js]([https://nwjs.io/](https://nwjs.io/))? I'm not
sure if it's better than Electron in terms of executable size and performance,
but definitely worth a shot.

Then there's [Kivy]([https://kivy.org/#home](https://kivy.org/#home)). Love
that.

~~~
fknop
One of the main guy behind nwjs was actually hired by Github to create
Electron.

~~~
sealord
Then I'm not sure to what extent nw.js solves the problem.

------
DonFizachi
I’ve had problems in the past trying to maintain a consistent look and feel
for my apps across the three major desktop platforms. I was only able to
recently achieve this by creating a dotnet core web app (served by the kestrel
server) that is rendered by an Electron (chromium) app. With this done, I
wrote scripts to create deployment packages for Window, Mac Os and Linux
(deb). I can say my life has been been made a little easier.

The fact that the dotnet core app does the heavy lifting makes the whole
application relatively fast.

See an example here
[https://www.ccasystem.io/Resources/DownloadDesktop](https://www.ccasystem.io/Resources/DownloadDesktop)

------
0x445442
HTML and JavaScript in the browser can still be done on the desktop. If you
are willing​ to make HTTP requests to localhost then there's a number of
possibilities. Golang for example cross compiles easily.

------
tomjen3
You have two options: either make the app work natively with your platforms,
sharing all the code that does not directly work with platform only features,
or use something that can run things on multiple platforms.

I would personally lean towards doing the last, with the target being the JVM
-- that doesn't have to mean use Java, as there are many much better languages
that target the JVM.

------
bouiaw
If you can, wait WebAssembly support for Web/DOM API and support from
languages like Kotlin/Swift. This will be a game changer.

~~~
m_fayer
I hear people say this and am always incredulous that this stack would be
available (let alone viable) in the next 5 years.

~~~
bouiaw
As people were incredulous when I said last year WebAssembly will be shortly
available in the 4 major browsers, and now it is ;-)

------
dilap
As a user, bespoke apps (or frontends, anyway) for each platform are obviously
ideal. Failing that, Electron is alright. Qt is pretty awful.

As a dev, Unity is nice, but brutal on batteries for normal apps. I wonder if
there's a way to hack it to only run the various loops on event changes and
thereby be more efficient...

------
roryisok
I mentioned this yesterday on another thread but it seems relevant here. I
really wish MS would make something like this for .net core. I love c#, it's
performant and easy to code in. Would love to have some sort of cross platform
UI to go with it.

Here's hoping some Microsoft people are reading this

------
severino
Mostly Qt, but also JavaFx (formerly Swing) when having to use some popular
Java library or existing code.

------
Entangled
I believe Kotlin will eat everybody's lunch real soon. Be prepared.

~~~
jonathonf
Why will it do that?

------
9214
Red language

~~~
walterbell
Is OSX support ready?

~~~
vram22
Check out their site red-lang.org. If I'm not wrong, it features the latest
posts from their blog. That should tell you if it is ready, if you monitor it.
Also, there was a fairly long and interesting thread about Red some days ago
here, just like the recent interesting one about the D compiler being open
sourced. It's been fun and educational to read the recent spate of programming
language-related blog posts, for me. Hope it continues.

------
omgtehlion
Depends on what platforms.

I'd choose C

------
accordionclown
what is your language of choice? javascript, perhaps?

------
sidcool
Adobe Air?

------
PaulHoule
Javafx

