News for hackers. Stuff that matters.
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by phtrivier on Thursday April 25, 2019 @12:58PM (#19750101)
So many sub-debates hidden in this "cross-platform native GUI":

1) I want to write a GUI code once

2) I want to ship something that works on Windows / Linux / MacOS

2.1) I want to ship something that looks the same on Windows / Linux / MacOS

3) I want to ship a binary that works on Windows, a binary that works on Linux, a binary that works

3.1) I want to ship a small and efficient binary

4) I want to ship something that looks like a Windows app on Windows, a Linux app on Linux, a MacOS app on MacOS, etc...

(By definition, "I want to ship something that looks the same everywhere and looks like an app of my host" is meaningless, right ?)

The "holy grail" seems to be:

5) "I want to write a GUI code once that generates small efficient binaries that looks exactly like an app of the host OS, and if possible looks the same everywhere, and let me go back to writing my business logic rather than agonize over drawing a button."

It's seems from the debate that nothing obvious fulfills 4 and 5.

Then it comes to which requirement you're ready to drop.

If you're ready to drop requirement 2) , I suspect you're doing MacOS specific, go for it ;)

If you're ready to drop requirement 1) , I suspect your managers / salespersons disagree.

I suspect your manager / salespersons do not care about requirement 3.1), but it's debatable. Use Qt/Electron, and ship something.

I suspect your manager / salespersons do not care about requirement 4), and I suspect they're esthetics, which can not be defended.

I gave up waiting for someone to make 5, and don't have the resources / skill / time to do it myself. And maybe we should stop caring and watch the sky instead.

I hope someone is able to get to 1 + 2.1 + 3.1 someday.

I'll use that.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by jcelerier on Thursday April 25, 2019 @04:14PM (#19752080)
> 1) I want to write a GUI code once

> 2.1) I want to ship something that looks the same on Windows / Linux / MacOS

> 3.1) I want to ship a small and efficient binary

well, with Qt I write my code once, which looks the same on windows / linux / osx / $nicheos and the result is fairly performant - I've got tables with tens of thousands of elements which update at rates greater than 100hz and the UI does not bat an eye. I'm not even using the GPU-based scene graph (QtQuick) but instead uses the CPU-based raster engine. Here's the software I'm developing : https://github.com/OSSIA/score/

So what is missing ? For what it is, the binary is relatively small (and I also link against LLVM and a few other large libraries, and am not even doing global static linking + LTO...).

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by phtrivier on Thursday April 25, 2019 @05:13PM (#19752568)
Out of curiousity, how big is your binary ? Seems like everyone does not have the same definition of "small", hence the brackets ;)

But sure, qt seems to hit 1,2,3 , although 3.1 will fuel flamme wars that we dont realky care about as long as you can ship code. Good for you !

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by ensiferum on Friday April 26, 2019 @04:22AM (#19755650)
I've got tables of millions of rows and can also confirm Qt just performs!
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by bryanphe on Thursday April 25, 2019 @02:28PM (#19751115)
Great list and summary! So often these concerns get conflated.

We're working on a framework that address 1, 2, 2.1, 3, and 3.1 - Revery [0] - a React-like framework that compiles to native code, built with ReasonML [1]. I believe that the React pure-functional model of UI-as-a-function-of-state is such a powerful paradigm, and not leveraged on native today - ReasonML is a perfect fit for that.

Bullet point 4 is a non-goal for Revery, but our sister project, Brisk [2] is built on platform widgets.

I'd personally also add a couple of dev experience bullet points or ideas to the "holy grail":

6) Fast / instant compilation time

7) Hot-reload (see changes to the app instantly)

We're not there yet, but we hope we could also get to the point of including 6/7 - essentially bringing some of the great aspects of React/Redux to desktop application development, with native code.

- [0] Revery: https://github.com/revery-ui/revery

- [1] ReasonML: https://reasonml.github.io/

- [2] Brisk: https://github.com/briskml/brisk

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by amedvednikov on Thursday April 25, 2019 @01:21PM (#19750341)
I'm working on something that might do #4 and #5:

https://vlang.io/#ui

An example of a small GUI app:

https://github.com/vlang/v/tree/master/examples/users_gui

The app is about 100 KB on all platforms with zero dependencies and uses native toolkits (WinAPI, Cocoa).

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by canada_dry on Friday April 26, 2019 @12:43PM (#19759390)
V looks pretty slick, though your 'comparison' to nim (https://vlang.io/compare#nim) is incomplete.

i.e. you don't actually write comparable code. Instead, you just lambast how slow the compiler is.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by nimmer on Sunday April 28, 2019 @12:01PM (#19771830)
The comparison is very biased. Various claims are not true or provided without context.
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by amedvednikov on Saturday May 04, 2019 @12:44PM (#19827563)
If you say what exactly is wrong, I'll update the page.
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by phtrivier on Thursday April 25, 2019 @05:03PM (#19752487)
As everyone on HN, looking forward to being able to use the vlang compiler (sorry, you're going to have a hard time making anyone use V as the language name, for sad search engine reasons ;)
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by gaze on Thursday April 25, 2019 @04:16PM (#19752113)
I absolutely love this project.
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by holy_city on Thursday April 25, 2019 @01:34PM (#19750505)
webview kind of satisfies 1 + 2.1 + 3.1 today.

Same idea as Electron but it wraps the OS webview instead of Chromium (Cocoa/Webkit, gtk-webkit2, MSHTML, and soon EdgeHTML). The minimal test app is 255kb in size, the static lib is just 48kb (MacOS).

https://github.com/zserge/webview

And I get, "but Safari/IE/whatever are still different platforms!" I'd argue that the edge cases between browser rendering of HTML + CSS + JS is much better to deal with than the architectural and language differences between the native GUI APIs on each platform. As long as you're not pulling in an obscene amount of JS dependencies, webview is very sane.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by Wowfunhappy on Thursday April 25, 2019 @02:50PM (#19751317)
> 2.1) I want to ship something that looks the same on Windows / Linux / MacOS

Why?

I want my macOS apps to use Mac-native UI elements, and Windows apps to use Windows-native UI elements. (There is no one native Linux UI, so we can leave that one aside...)

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by jcelerier on Thursday April 25, 2019 @04:03PM (#19751983)
I want the complete opposite. I use the three systems almost daily, and I freaking hate to have to context-switch to the platform's look-and-feel. Thankfully KDE apps work mostly everywhere nowadays.

Most of the users of the FOSS software I'm developing also switch platforms depending on the project they're in, but they want the software to be the same everywhere for instance.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by Wowfunhappy on Thursday April 25, 2019 @07:10PM (#19753384)
Are differently-styled UI elements really a mental burden? I'm not advocating for wholly different UI's on each platform—just that if your application uses checkboxes, and I'm on a Mac, I should see Mac checkboxes.
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by Retra on Friday April 26, 2019 @11:42AM (#19758671)
It's probably more the behavior things. Keyboard shortcuts, focus behaviors, menu placement, file dialogs, etc. Settings panels in MacOs should take effect immediately, while in windows you have to click ok/apply... inconsistencies like this can lead to frustration.
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by Wowfunhappy on Friday April 26, 2019 @02:40PM (#19760608)
But not doing this brings about an even worse kind of context switching—between apps on the same platform.

As annoying as it is to switch form cmd+C to ctrl+C when I go from Mac to Windows, it's even worse when a Mac app uses ctrl+C.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by jcelerier on Friday April 26, 2019 @01:18PM (#19759746)
this, and also the need to write three (or four if you want to do separate stuff for KDE & GNOME) times the amount of documentation to accomodate for the different "default" behaviours.
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by Macha on Thursday April 25, 2019 @03:12PM (#19751509)
Because someone gave the brand team authority and they can't have their brand take second place to Microsoft's or Apple's.

Branding teams are in my experience very picky about lots of stuff. For example, my employer's brand design team recently released a rule that when our logo is included alongside others logos in a list of companies involved in a partnership, it may not be included in a vertical list, only a horizontal list.

Using the standard background colour for the platform on your app when it's not one of the brand design team approved colours? Also out.

etc. etc.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by phtrivier on Thursday April 25, 2019 @03:14PM (#19751520)
I maybe biased after doing web work for toi long, but "hey, the site does not look the same in safari than on edge" has occupied a lot of my time.

It's a common concern to avoid confusing users who switch OS often (eg when demoing on someone else's machine.)

The fact that it contradicts the other requirement ("but it does not look like the other apps") is lost on no one.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by bryanphe on Thursday April 25, 2019 @03:45PM (#19751799)
This is less fashionable now in the era of Electron apps - users are starting to expect apps that look _the same_ everywhere.

See VSCode, Discord, Spotify...

It's easier to get a single code-base that 'just works' across platforms if you have an abstraction that is truly cross-platform. One of the major value propositions of developing with Electron is this ability to develop cross-platform 'with confidence' - I can build an app on Windows and be 99% sure it's going to look function the same on OSX / Linux.

> I want my macOS apps to use Mac-native UI elements, and Windows apps to use Windows-native UI elements

That's a fine goal but it means you end up needing more platform-specific code. It's a trade-off, and there isn't a one-size-fits-all solution.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by zapzupnz on Thursday April 25, 2019 @06:50PM (#19753252)
But do people expect the apps to look the same? I think people want them to behave the same with a few visual features kept intact.

To take Discord as an example, I don't know that people actually can't live without the UI slavishly copied for every platform; I think people rather want light and dark themes on all platforms, message formatting to look basically the same, and for everything to be found in roughly the same place.

This idea that users expect apps to look the same is, I feel sure, something someone said and everybody has gone along with. In my experience, people want things to behave consistently — so if Discord had a native Windows client and a native macOS client, people would be more interested in whether or not they could still find the little microphone and headphone buttons at the lower-left of the screen, sod if the icons and colours are identical.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by dekhn on Thursday April 25, 2019 @06:05PM (#19752929)
I don't really have an attachment to any of the three platforms; I use all three. Moving between different windowing environments and UI designs is a huge context switch and provides no value to me (it's just eye candy).
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by favorited on Thursday April 25, 2019 @03:23PM (#19751608)
The only valid case for this (IMO) is really expensive professional apps. Where someone is going to spend years getting really, really good at using a piece of software, and you want them to be able to just use it the same way regardless of platform. And you especially don't want people to have to re-learn how to use your really complicated software if the host OS changes how scroll bars appear or the position of window chrome.

But I suspect lots of software companies would think that describes them, when in reality there's probably fewer than 10 products that meet that bar.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by iheartpotatoes on Thursday April 25, 2019 @04:34PM (#19752248)
Hmmm... node+electron solved MacOS/Linux/Windows, but the snag was I implemented everything in JavaScript, probably not doable for most folks, but for the past 4 years support has been very easy and I have encountered zero platform issues (except for icons on MacOS). I guess I'm the one anecdote that succeeded.
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by jonfw on Thursday April 25, 2019 @01:58PM (#19750782)
> I suspect they're esthetics

Totally unrelated to your point, but I'm curious as to what this word means in this context.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by phtrivier on Thursday April 25, 2019 @05:07PM (#19752509)
I mean I imagine a large part of the "look and feel" specificities in mac apps are questions of tastes and beauty and conventions rather than core functionality. And this matter, don't get me wrong, just not always at the same level as being able to use the app without waiting x months of more development. Sorry if the term was inadequate or sounded pejorative.
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by s_y_n_t_a_x on Thursday April 25, 2019 @03:31PM (#19751687)
ReactXP (https://microsoft.github.io/reactxp/) targets mobile and desktop platforms using the OS's native UI.

Windows support is implemented via https://github.com/Microsoft/react-native-windows and targets W10, Xbox, and Windows Mixed Reality.

MacOS support is experimental, but mostly working. Linux currently needs an Electron wrapper. Theoretically you could port one of the react-native-desktop projects to use GTK or Qt.

Then of course you have native iOS and Android components with Facebook's ReactNative and web support via React.

ReactXP wraps all of these projects allowing you to write React components and TypeScript code that is shared among every platform. It's the same workflow as Electron, even less so, with native UI.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by afturner on Thursday April 25, 2019 @01:15PM (#19750280)
This is a particularly good summary, thanks for that. At the end of the day, the only way for 5 to happen, is for a development project to architect the requirements and complexities way before even starting to code.
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by thosakwe on Thursday April 25, 2019 @04:50PM (#19752396)
Aren't 2.1 and 5 pretty impossible to have at the same time? How can you look like Windows on Windows, Linux on Linux, and Mac on Mac, all while looking the same everywhere?
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by phtrivier on Thursday April 25, 2019 @05:17PM (#19752599)
The 5 says "look the same if possible", which is fuzzy, contradictory, and exactly what people want, of course ;)
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by kristianp on Sunday April 28, 2019 @10:26PM (#19775382)
Don't forget the implicit:

6) Using my preferred programming language.

Re:Cross-Platform GUI Toolkit Trainwreck (2016) by rohan1024 on Thursday April 25, 2019 @02:04PM (#19750857)
soon flutter should be able to achieve your last requirement
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by phtrivier on Friday April 26, 2019 @03:53AM (#19755548)
From https://flutter.dev/ , it seems flutter mostly targets Mobile applications, is that the case ? Is there a "desktop app" port ?
Re:Cross-Platform GUI Toolkit Trainwreck (2016) by sebe on Friday April 26, 2019 @04:06AM (#19755595)
They are working on it, you can check the wiki/Desktop-shells link below for progress.

https://github.com/flutter/flutter/wiki/Desktop-shells

they say -

"Work is ongoing to extend Flutter to support desktop as a target environment, allowing developers to create macOS, Windows, and Linux applications with Flutter"