6 ms·
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 /
by phtrivier 8y ago
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.
- afturner 8y agoThis 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.
- amedvednikov 8y agoI'm working on something that might do #4 and #5: https://vlang.io/#ui https://vlang.io/#ui An example of a small GUI app: https://github.com/vlang/v/tree/master/examples/users_gui 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).
- gaze 8y agoI absolutely love this project.
- phtrivier 8y agoAs 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 ;)
- canada_dry 8y agoV looks pretty slick, though your 'comparison' to nim (https://vlang.io/compare#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.
- nimmer 8y agoThe comparison is very biased. Various claims are not true or provided without context.
- amedvednikov 8y agoIf you say what exactly is wrong, I'll update the page.
- holy_city 8y agowebview 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 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.
- jonfw 8y ago> I suspect they're esthetics Totally unrelated to your point, but I'm curious as to what this word means in this context.
- phtrivier 8y agoI 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.
- rohan1024 8y agosoon flutter should be able to achieve your last requirement
- phtrivier 8y agoFrom https://flutter.dev/ https://flutter.dev/ , it seems flutter mostly targets Mobile applications, is that the case ? Is there a "desktop app" port ?
- sebe 8y agoThey are working on it, you can check the wiki/Desktop-shells link below for progress. https://github.com/flutter/flutter/wiki/Desktop-shells 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"
- bryanphe 8y agoGreat 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 https://github.com/revery-ui/revery - [1] ReasonML: https://reasonml.github.io/ https://reasonml.github.io/ - [2] Brisk: https://github.com/briskml/brisk https://github.com/briskml/brisk
- Wowfunhappy 8y ago> 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...)
- Macha 8y agoBecause 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.
- phtrivier 8y agoI 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.
- favorited 8y agoThe 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.
- bryanphe 8y agoThis 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.
- s_y_n_t_a_x 8y agoReactXP (https://microsoft.github.io/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 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.
- jcelerier 8y ago> 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/ 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...).
- phtrivier 8y agoOut 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 !
- ensiferum 8y agoI've got tables of millions of rows and can also confirm Qt just performs!
- iheartpotatoes 8y agoHmmm... 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.
- thosakwe 8y agoAren'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?
- phtrivier 8y agoThe 5 says "look the same if possible", which is fuzzy, contradictory, and exactly what people want, of course ;)
- kristianp 8y agoDon't forget the implicit: 6) Using my preferred programming language.