10 ms·
Ask HN: What would you use to make cross-platform desktop application?
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.
- kevinherron 10y agoJavaFX looks pretty good right now... especially if you use Kotlin and TornadoFX with it.
- PaulHoule 10y agoJavafx
- sidcool 10y agoAdobe Air?
- 0x445442 10y agoHTML 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.
- sealord 10y agoHave 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.
- seanwilson 10y agoI 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.
- gkya 10y agoMy laptop has 2GB RAM. Firefox takes up about a quarter of it on average, Emacs is about 10-100MB, the system (Xubuntu) seems to take up about a GB, and what remains is indeed a few hundred megabytes. This means that I can run half an Electron app at a time on my machine. And normal people don't have more than 4-8MBs of ram on their computers. And high CPU and RAM usage drains battery, and most people are on laptops nowadays. So RAM and CPU use is still a thing for users. If anybody thinks otherwise, that's probably because they're in their bubble of hackers and have only a guesstimate about an ordinary user's use of a computer.
- jonathonf 10y ago> I would take opinions on here from developers with a big grain of salt. If you "Ask HN" for opinions how can you take those opinions with a grain of salt? Surely if you can't trust HN commenters then Ask HN is a waste of time.
- zzalpha 10y agoSpeaking as someone with an Ultrabook that had to run Chrome, Outlook, Skype, and various office apps and so forth, this attitude infuriates me. Slack uses 400-500MB of memory. That's 15% of my RAM. For a chat application. Every Electron app is in this range. None share a runtime or memory footprint. Believe it or not, not everyone has 16GB of RAM. This level of inefficiency is utterly inexcusable.
- open-source-ux 10y agoLazarus 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/
- irishcoffee 10y agoObligatory: 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."
- butz 10y agoPyQT is a nice alternative if you don't know/want to program in C++ .
- gkya 10y agoAFAIK Qt also has support for writing apps in JS (isn't that what Qml is?).
- pabloski 10y agoYes and no. You need a C++ skeleton to integrate the Qml files. Also Qml/JS is slow and doesn't support all the features of Qt/C++. Practically you use Qml for the GUI, but C++ for the logic. Or you can create components in C++ callable from Qml, but this requires some extra code ( and work ).
- Hydraulix989 10y agoOr wxWidgets for a native GUI look.
- ThePhysicist 10y agoSeconded: - 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).
- dilap 10y agoAs 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...
- nkkollaw 10y agoWho 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.
- holydude 10y agoHuh i certainly can tell that it is not native. It's huge for what little it does
- deedubaya 10y agoI've just finished writing an Electron app. If you're already in the front-end web development world, the learning curve will be mild. The hardest part had little to do with Electron and more with the rapid changes in the JS world. It's hard to keep up.
- dopamean 10y agoElectron certainly isn't unpopular with the people who use applications built with Electron.
- nkkollaw 10y agoI doubt more than 95% of those who have Spotify install know what Electron is.
- frankwiles 10y agoWe built Spectrum (https://www.devspectrum.com https://www.devspectrum.com) for filtering logs and it was great to work with and plenty fast.
- nathan_f77 10y agoYou should give VSCode a try. I recently switched from Sublime to VSCode, and I'm very happy with it. Startup is a little slow, but the editor is blazing fast.
- nurettin 10y agoWe use delphi at work. It is suited to building in-house apps iOS, Android and Windows, as well as web services on Linux.
- candiodari 10y agoWhat version of Delphi are you using ? Don't you find the lack of 3rd party library support somewhat difficult ?
- nurettin 10y agoWe 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 10y agoGreat 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 10y agoThere 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/promotional-download https://www.embarcadero.com/products/delphi/starter/promotio...
- vram22 10y agoSeems 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.
- bouiaw 10y agoIf you can, wait WebAssembly support for Web/DOM API and support from languages like Kotlin/Swift. This will be a game changer.
- 9214 10y agoRed language
- walterbell 10y agoIs OSX support ready?
- vram22 10y agoCheck 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.
- 9214 10y agoShould come with 0.6.3 release ASAP
- isaiahg 10y agoAfter this comment I checked it out. This language is blowing my mind and I've only just got to how file writing/reading and conditionals work in the docs.
- 9214 10y agoFeel free to ask any questions on gitter chat, it's always nice to see new faces!
- jonathonf 10y agoStill missing the whole cross-platform GUI thing though. $ ./red Compiling compression library... Compiling Red console... --== Red 0.6.2 ==-- Type HELP for starting information. >> view [text "Hello World"] *** Script Error: view has no value *** Where: catch
- joewood1972 10y agoI 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 10y agoElectron hasn't stopped Spotify from making the most widely used music client and VSCode from making the third most popular IDE.
- gkya 10y agoI'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.
- dopamean 10y agoSpeaking just for myself here... I use Spotify every day and I can guarantee that I would switch if the software experience was bad. I honestly can't think of a time the app crashed. It can switch between my mobile devices and the desktop seamlessly almost every time. The overall design is intuitive enough _and_ it happens to come in a color scheme that I love. I used to find my music elsewhere and could do it again if I had to.
- lj3 10y agoSwitch to what? Everything else costs quite a bit of money (buying songs individually). Or you could pirate your music. Either way, it takes a shit ton of time to build up a halfway decent music library from scratch. Especially when the convenience of 'just search on spotify and add the entire artist to a playlist' is right there for free. I've had the spotify app crash my computer a few times. And then there was that fiasco a while back about it writing many, many gigs of data to SSDs and shortening their lifespan. Convenience will always trump software quality, but as soon as there is a competitor with better working software at a decent price, I'm jumping ship.
- dopamean 10y agoI'd switch to Apple Music or Google Music. Both are services I've tried that work for me.
- 10y ago
- tomjen3 10y agoYou 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.
- jhasse 10y agowxWidgets. 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.
- gkya 10y agoEmacs. 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.
- omgtehlion 10y agoDepends on what platforms. I'd choose C
- DonFizachi 10y agoI’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
- mherrmann 10y agoI'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-in-2016/ https://fman.io/blog/picking-technologies-for-a-desktop-app-... [3]: https://fman.io/blog https://fman.io/blog
- SyneRyder 10y agoMaybe 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.
- severino 10y agoMostly Qt, but also JavaFx (formerly Swing) when having to use some popular Java library or existing code.
- Entangled 10y agoI believe Kotlin will eat everybody's lunch real soon. Be prepared.
- jonathonf 10y agoWhy will it do that?
- sktrdie 10y agoWhy 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 10y agoI'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.
- mingodad 10y agoFLTK 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) ...
- accordionclown 10y agowhat is your language of choice? javascript, perhaps?
- roryisok 10y agoI 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