6 ms·
Ask HN: How to build a desktop app in 2022
I have a personal project I’ve been working on that is a desktop app with a UI that has some fairly complex data visualizations.
I’ve been using Electron because I know JS well and can leverage D3.
The problem I’m facing is that I sometimes go for months without working on it, and it feels like everyone I start up I’m running into some dumb JS/TS/Electron ecosystem issue that takes me a few hours to debug (if I don’t just give up first.)
What are some good modern tools/frameworks for building native Desktop apps? Bonus points for cross-platform support.
- shams93 4y agoTake a look at qt
- lampshades 4y agoOr gtk if you prefer Gnome.
- smoldesu 4y agoI wouldn't recommend GTK until they figure out their text rendering issues (among other things). I've loved the library in the past, but it's pretty bad from a developer perspective these days.
- Shadonototra 4y agoImGui https://github.com/epezent/implot https://github.com/epezent/implot
- solomatov 4y agoElectron is much better in my experience than most other cross platform toolkits. It gets better with troubleshooting as you use it more.
- treeman79 4y agoReminds of the old VB6 stuff from 90s. You know it’s screwed up. But your so productive in it you just don’t care.
- KSPAtlas 4y agoI prefer not to think of electron as a toolkit, but as an embedded web browser.
- aaaaaaaaata 4y agoIs there any Electron usecase that Tauri isn't better suited for?
- solomatov 4y agoA big problem with Tauri is that it doesn't use the same browser everywhere. You should maintain support different browsers, with different version on different platform. With Electron it's a just fixed version of Chrome.
- riidom 4y agoGodot https://news.ycombinator.com/item?id=24043427 https://news.ycombinator.com/item?id=24043427
- tough 4y agoTauri is the new Electron. Look at Tamagui if you want react native (via expo) + web (nextjs) it's still on beta but looks promising The thread yesterday was pretty quiet IMHO https://news.ycombinator.com/item?id=31287939 https://news.ycombinator.com/item?id=31287939
- benibela 4y agoI use Lazarus But it is not modern. It is like Delphi was 20 years ago
- karmakaze 4y agoIf I was going to try using something new it would be Flutter/Dart. If I was going to use something (old) that might be Qt, or something that I know from way back straight up Java Swing. For something big a framework like Eclipse RCP. Should be able to use Kotlin for these now at least.
- Snowworm 4y agoI don't understand the hype around Flutter for desktop. It's possible to make a cross platform app, but it only looks good for Android and iOS. I haven't used react native, but I imagine it would be better for cross platform apps because you could create a separate UI for mobile and web, but keep the same backend logic for both.
- karmakaze 4y agoJust saw the timely announcement of Flutter 3. There's some good comments on https://news.ycombinator.com/item?id=31344863 https://news.ycombinator.com/item?id=31344863
- mhoad 4y agoThat was true for a while but no longer. Not sure when you last tried it but maybe take a look here especially in the section of the readme where it has downloads for platform specific sample apps https://github.com/flutter/gallery https://github.com/flutter/gallery
- realusername 4y ago> I haven't used react native, but I imagine it would be better for cross platform apps because you could create a separate UI for mobile and web, but keep the same backend logic for both. As far as I know, all react native gtk are abandonned so I would not be so sure about that, flutter does better in this area
- cercatrova 4y ago> It's possible to make a cross platform app, but it only looks good for Android and iOS. Why is that? Flutter is best suited towards owning your own UI and design language, and not relying on Android, iOS, Windows, macOS etc specific designs, like many companies these days (Spotify, Slack).
- deleted 4y ago[deleted]
- lazypenguin 4y agoThe road is filled with dissatisfaction. I love desktop apps and developing at that layer but it’s clear that the segment has stagnated over the years. QtWidgets - decent experience, lots of functionality out of the box. Rapid iteration is lackluster compared to web dev. Great docs. Less obvious “best practices”. Works well from C++ and Python. Distribution is annoying. QML - Not much experience, didn’t attract me since less advanced widgets available. Dear imgui- very fun to program using this lib. Can get decent visuals and functionality. Breath of fresh air to remove a layer of complexity. Start to miss some QoL features (animations, undo/redo, etc.). Low level, no docs (examples + reference docs), hard to style. C++ but has bindings in tons of languages. WPF - decently powerful. Kind of stagnated and windows only. Can still produce solid UI. C# Alternatives: Godot, Webview2, GTK, fltk
- mikewarot 4y agoLazarus is a cross platform and open source GUI builder based on Free Pascal. If you can handle begin and end instead of { }, you'll get used to it fairly quickly. As a bonus, it does strings that you never have to allocate or deallocate, and can handle a gigabyte of data. I've run Lazarus on a Raspberry Pi Zero W (the old one), Linux, and Windows.
- thijsvandien 4y agoAs much as I like Lazarus, I wouldn't recommend it for complex data visualizations by someone skilled in web tech.
- 0x20cowboy 4y agoIf you want to keep with the browser based rendering, I've used this for a couple side / internal projects: https://github.com/webview/webview https://github.com/webview/webview Works quite well for normal things, but 3d webgl stuff can go a bit haywire.
- rramadass 4y agoC++ and Qt; all in one : https://en.wikipedia.org/wiki/Qt_(software) https://en.wikipedia.org/wiki/Qt_(software)
- curious-robin 4y agoRecent evaluation (not mine) can be found here: https://github.com/benjamin-thomas/wails-elm-template#note-on-performancealternatives https://github.com/benjamin-thomas/wails-elm-template#note-o... This user ends up with Wails + Elm. Some further discussion on his choice here: https://discourse.elm-lang.org/t/fancy-some-gui-programming-with-elm/8330/16 https://discourse.elm-lang.org/t/fancy-some-gui-programming-... If your visualization needs are covered by https://elm-charts.org/ https://elm-charts.org/ then this might be a fitting combo for you.
- mhoad 4y agoFlutter is the most obvious answer here to me. Very modern, cross platform (windows, mac, linux, fuchsia, iOS, android, web and embedded devices), excellent tooling / developer experience, outputs to native compiled code, battle tested in a lot of real world scenarios against billions of dollars in revenue like Google’s Ads apps for example. On desktop specifically, Ubuntu last year or two said they were going all in on providing first class Flutter support on Linux and would be using it as their new default for their own desktop apps starting with the installer in the recently released Ubuntu 22.04 (repo link here https://github.com/canonical/ubuntu-desktop-installer https://github.com/canonical/ubuntu-desktop-installer) Should be simple to pick up if you have a JS or even better good TS experience. https://flutter.dev/ https://flutter.dev/ also here is a good charting library to get you started https://github.com/google/charts https://github.com/google/charts
- Ambolia 4y agoHow is the responsivity of the UI? I found that all web based UIs have weird delays, like you start writing text and the first couple of letters get lost, or weird delays on pressing buttons that 90s native UIs never had.
- mhoad 4y agoWeb support is early days at the moment and right now but you can take a look here https://gallery.flutter.dev/ https://gallery.flutter.dev/ to see for yourself where it’s at. I’ve seen hints of the medium term plan however which is AFAIK move from optimised JS to WASM, bring in WebGPU support, use faster canvas based rendering (rather than DOM although both are supported) and rewrite the rendering engine which is currently happening here https://github.com/flutter/engine/tree/main/impeller https://github.com/flutter/engine/tree/main/impeller I don’t suspect those problems will remain on web for very long, that looks like a very credible path to push out great native level performance on web as well to me.
- pjmlp 4y agoI would go for whatever is native on each platform (on Windows, WPF is still the best way, ignore anything WinRT/UWP related), as what bonus points are concerned, Qt would be my answer. If staying with Web stack is relevant, then PWAs.
- viraptor 4y agoIf you're ok with electron's size, then you could look at dotnet + avaloniaui. WPF-like and very portable, desktop and mobile. http://avaloniaui.net/ http://avaloniaui.net/ I'm mentioning the size because dotnet itself will take some space unless some other app already installed it. Or you can try native compilation with it.
- Shadonototra 4y agono wonder desktop apps sucks, look at the suggestion people are making in the replies... i am concerned, ashamed, and very sad
- mikewarot 4y agoWhat kind of visualization are you talking about? Charts, ray tracing, video?
- adamcrow64 4y agoFlutter. It gets the job done.
- ihndan 4y agoTauri if you are already with Rust. Here are some open source app built with Tauri https://github.com/tauri-apps/awesome-tauri https://github.com/tauri-apps/awesome-tauri
- cpach 4y agoDo you want to support all of Windows, Linux and macOS? If so, maybe QT? If not, you have some other options. E.g. macOS has it’s own proprietary libraries you can target.
- farseer 4y agoIf you are using electron for cross-platform, consider that you are already on the right track from the available options. Everything else is much worse.
- epirogov 4y agoI wrote my desktop app in this winter with WinUI 3 Project Reunion in hope it will be available on linux soon. Currently this supperior project with large list on anccestors WPF, UWP and Xamarin can be compiled to Windows, MacOs and Android without any code and layout changes.