Ask HN: 2020, Language and Framework for Cross Platform Dev (Especially Desktop)

6 points by aliezsid ↗ HN
I'm building a certain project and even though I'm a little biased towards just developing it for the Mac since I don't want to write and/or maintain 3 repositories for it , I'd like to know what HN community thinks would be a good selection right now

22 comments

[ 3.1 ms ] story [ 66.7 ms ] thread
Flutter supports iOS and Android fully and beta support for Web, Windows and Mac all from a single code base.

It has a pretty awesome developer experience and for me is the clear winner for Cross Platform Dev.

I've tried flutter components and as much I liked Dart, for some reason I wasn't a fan of the Layout system and the archived outputs are a bit bulky so those are a few reason that drift me away from it.
(comment deleted)
The layout system is my favorite thing about Flutter. For one, there's only one not Android vs iOS. Secondly, it's not CSS. As a bonus, it's easy to compose or programmatically generate.
I'd agree that it's easy to compose but the API of the properties the components expose are inconsistent in certain cases and if I can get a native build out of it, I shouldn't be complaining about a minor issue
Electron works great if done right (see Visual Studio Code).
I mean, the unneeded bloat from electron isn't something I want. I don't like when my apps take up a lot of space on the system when it doesn't need to.

But thanks anyway. I've built a few apps using Electron before.

It doesn't sound like cross platform development is very important for this project.
and why do you think so?
Because if it were the main priority, you would have no reservations using an inefficient but working solution like Electron, is probably what the parent means.
I want the app to cross platform but not at the expense of a Ram hungry app that I just throw out. And yeah, i wouldn’t mind writing the logic in a language like rust or C and then invoking it from the native bindings If there’s no other solution out there for me to achieve performance over the so called “Let’s bundle the whole browser with every app” working solution.
You should check out Flutter then, it compiles to native machine code for mobile and desktop (Android, iOS, Windows, macOS, Linux are all supported with native compilation), and uses WASM for web. It's a much more performant solution than Electron. Only thing is the official Flutter desktop implementations are unstable for production, but there are unofficial implementations which are stable [0] [1]. You can use those until the official implementation is stable. You can also use Dart's FFI if you want but since it's compiled instead of interpreted like JS and Electron, you probably don't need to, the performance will be there.

You also said you don't like the layout system, but there are packages for that [2]. Let me know what else you would find annoying, there are usually packages for most things. There are even algebraic data types in Dart through code generation.

[0] https://github.com/flutter-rs/flutter-rs

[1] https://github.com/go-flutter-desktop/go-flutter

[2] https://github.com/ReinBentdal/styled_widget

Makes sense. Will give these a try
In my experience, the amount of time it takes to "do it right" with electron completely negates the whole "its just simple web technologies you already know" selling point.

Yes VSCode has decent performance, but watch some of their tech talks about what they have to do in order to reach that level of performance - its insane. The amount of time, effort and increased complexity that is required to make an electron app get close to native performance makes it not at all worth it. And despite all those efforts, VSCode STILL isnt as fast as Sublime.

Electron is like a welder trying to build a house out of metal - sure he probably CAN make it work, eventually, but he really should have just learnt brick-laying and done it the proper way. Even though he managed to build a house without learning anything new, it would've been quicker and better if he had just sucked it up and learnt how to lay bricks rather than trying to build a house out using a far inferior material. (I'm sure there is a better analogy out there but you get my point).

A lot of software is vastly less complex than VScode so getting acceptable performance is less complex. What Microsoft does is typically an edge case...or an Edge case in Microsoft's case considering the switch to Chromium based web browser probably meant that level of work was going to happen anyway.
Qt, because it has reasonably mature bindings in most languages you'd want to use. The bindings for Python seem the most mature though I have used the Golang bindings with reasonable success as well.
Back end in portable C or C++. Front end using the native OS GUI features. Compile separately for each platform. Many developers may not be a fan of this, but it's the best kind of cross platform for the users. If you need something of heirloom quality on the front-end it's the way to go.

But if front-end GUI widgets literally are your app or a high % of it, then this falls apart. You're basically maintaining 3 separate apps at that point.

it is mostly GUI, yeah I might just go with the native languages to build it since the bundle sizes and performance are the kinda important. I guess I'll start with one platform first and then get to the others.
For desktop across Windows/Mac/Linux without further context given: Qt would be my default answer
There’s 2 projects. One is my take on a code editor and the other is a minimal inventory management system and even though I can gt through with just building one for Mac and the other for just Windows. I’d still prefer going with. Cross platform approach
This is something I've often wondered and don't have a great answer for. Ideally, I'd like to use a statically-typed, garbage collected (maybe reference counted/managed) language.

There used to be Adobe AIR, JavaFX, Silverlight. Now we have Electron, Qt, maybe Flutter soon. Is Eclipse RCP or Netbeans still viable?