News for hackers. Stuff that matters.
Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by jampekka on Wednesday November 29, 2023 @03:59AM (#38457136)
Web won/wins because "native" apps are pain to develop, pain to port, pain to build, pain to debug, pain to install/deploy. DOM is by far the best layouting engine for GUIs. Javascript is a decent enough language and way faster to develop with than e.g. C#/C++/Java and Javascript JITs are miraculous. The modern web engines support a lot of functionality with quite sane, uniform and interoperable interfaces. NPM is perhaps the best depenency management system and has huge amounts of libraries. And a lot of them quite high quality.
Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by ogoffart on Wednesday November 29, 2023 @04:13AM (#38457215)
I agree that language usually associated to "native" apps are actually not so good to write desktop app business logic. Computer have become fast enough that higher level programming language (JavaScript, TypeScript, Python, ...) are just fast enough and easier to use. That say, I disagree that the DOM and the Web in general are the best technologies to do desktop UI. DOM is originaly made for documents and complex UI was retrofitted in a way that you need to use extra framework on top and workaround lots of issues. Plus you need a heavy browser to make it run. With Slint [1] we're trying to make a Desktop UI framework that can be used from JS/TS, without bringing a browser.

[1] https://slint.dev

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by self_awareness on Wednesday November 29, 2023 @05:14AM (#38457620)
Why do framework authors not respect the keyboard focus and standard keybindings? Do you find them unnecessary/unneeded?

For example, the table view doesn't support browsing through pagedown/pageup/home/end, although it supports moving by cursors. Clicking a button with the mouse, and trying to re-click with the keyboard (enter, space) it also doesn't work -- mouse click doesn't move the keyboard focus from the previous widget.

Do you target only mouse/touch users with this framework?

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by jampekka on Wednesday November 29, 2023 @09:48AM (#38459971)
DOM has quite a bit of legacy cruft but you don't have to use those and the new layouting like flexbox and grid and media queries are IMHO way better than anything else out there.

Slint seems very good especially for environments where you don't have a (modern) browser, like embedded, and the API looks clean and first class Node.js is great. And the website is great. Property binding looks promising Separating the widget definition from the code is probably a good idea, although IMHO the content-style-logic separation of HTML/CSS/DOM is even better.

What brings me some really bad memories is the widget-tree-style API (especially with absolute pixel units in all the examples). But this may be prejudice from my part.

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by thefz on Wednesday November 29, 2023 @04:30AM (#38457323)
> Web won/wins because "native" apps are pain to develop, pain to port, pain to build, pain to debug, pain to install/deploy

Web apps are a pain to develop, pain to port, pain to build, pain to debug as well.

Besides:

In a desktop program, any network traffic is just the necessary data.

In a web program, all the network traffic is the necessary data + the interface itself.

I'll never get over how inefficient this is.

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by jampekka on Wednesday November 29, 2023 @08:20AM (#38458997)
Basic web apps work very consistently across browsers. For more advanced stuff you may have to limit to e.g Chrome/Chromium. With iOS you may be hosed, but with iOS you are typically hosed anyway if you want to do cross-platform.

You can make web apps without building at all. But if you want to build, even webpack is heaven compared to e.g. CMake. And there are a lot better tools nowadays, e.g. esbuild. DevTools are by far the best debugging environment around.

The interface is typically data wise very small compared to the data. It gets cached. And if you are still worried, you can use Service Worker, and it works even offline.

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by Rochus on Wednesday November 29, 2023 @05:01AM (#38457534)
> "native" apps are pain to develop, pain to port, pain to build, pain to debug, pain to install/deploy

Not really. Languages and tools have been very good since more than twenty years with comfortable IDEs and cross-platform frameworks, and the result can be a single, statically linked executable which you can just download and run. See e.g. Qt or Delphi. Of course, one can also make things unnecessarily complicated.

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by jampekka on Wednesday November 29, 2023 @08:09AM (#38458868)
Even in the case you manage to make a statically linked executable that works consistently, you still have to compile it to all platforms. And have to debug it on all platforms. And still have to download, hunt down in the file system and potentially require admin to grant rights to run it. With web it's just link or url and works the same with any underlying OS if you're not using some bleeding edge features.

And at least IMHO the languages and tools are far from very good. Qt Creator is horrid, Qt C++ is a weird language of its own and requires hackery like moc. And if you want to do something not included in Qt, it's often welcome to the hell that is CMake et all.

Delphi is proprietary, Windows-only and the language is niche and IMHO not very good even compared to Qt C++.

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by Rochus on Wednesday November 29, 2023 @09:56AM (#38460089)
> you still have to compile it to all platforms. And have to debug it on all platforms

That's no problem at all. In case of Qt I only need a C++98 compiler for each platform, and also Qt Creator is available everywhere. Usually I only have to debug on the development platform though, since it is the same code on all platforms, and the framework in use abstracts the platform away.

> And still have to download, hunt down in the file system and potentially require admin to grant rights to run it

Downloading is not really an issue, is it? Just download one ZIP or TAR.GZ or DMG, unpack it and run the executable. No admin rights required.

> Qt Creator is horrid, Qt C++ is a weird language of its own and requires hackery like moc

Well, that's your opinion. In fact the tool is very good, the call and linking of moc and generated files is transparent, and C++ is an excellent work horse.

> do something not included in Qt, it's often welcome to the hell that is CMake et all.

No problem at all. Of course you have to know both Qt and C++ good enough, but that's something a developer can master.

> Delphi is proprietary, Windows-only and the language is niche and IMHO not very good even compared to Qt C++

There is FreePascal/Lazarus which is open source and runs even on more platforms than Qt. Even Delphi runs on other platforms. Whether you prefer C++ or Object Pascal is a matter of taste.

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by superchroma on Wednesday November 29, 2023 @05:26AM (#38457707)
Web won because of the long running con of "write once, run everywhere", which has in practice caused a myriad of extra work as it was not true of:

- operating systems,

- browsers,

- aspect ratios, or,

- devices

Web technology is a scam, constantly reinventing itself. There are no true experts, everyone is scrabbling for the next framework which promises the world but just expresses the same set of problems in a new and interesting syntax, with increasingly unintuitive paradigms.

It is eternally "almost getting there", near enough but not good enough, needing to own increasingly more things that should rightly belong to an operating system to work acceptably.

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by jampekka on Wednesday November 29, 2023 @08:33AM (#38459111)
What is this magical existing technology that works cross-OS, aspect ratio and device better than web?
Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by superchroma on Wednesday November 29, 2023 @08:38PM (#38468101)
My point was that web tech isn't those things. At that point we're just comparing it to one or more native apps, and for most jobs I'd prefer to work on and prefer to use a native apps ten times out of ten.
Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by pyeri on Wednesday November 29, 2023 @05:33AM (#38457756)
The "write once, run everywhere" was actually a genius paradigm for the applications they were intended to, the predominant success of Android OS which is mostly based on the cross-platform JVM runtime is proof of that. Java EE and web frameworks like Spring are also vastly successful in the enterprise sector.

But perhaps that paradigm becomes a bit difficult to implement in a landscape like Linux where there are already interoperability issues between native toolkits like GTK, Qt, WxWidgets, etc. Indeed, which one would you call the "native linux GUI toolkit" among these! When you add other complications to the mix like various desktop environments, X vs Wayland, GTK 2/3/4 inconsistencies, etc., it's understandable why a desktop developer would want to throw away their tools and run away from the linux desktop!

It is indeed quite a miracle that something like Java Swing/SWT works on top of all this fragmented mess at all.

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by jampekka on Wednesday November 29, 2023 @08:34AM (#38459131)
Android OS runs on nothing but Linux. And it's a mess. Swing/SWT I won't even comment on.
Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by TheLoafOfBread on Wednesday November 29, 2023 @07:15AM (#38458467)
So how fast can you develop web application which support Bluetooth regardless of a browser?
Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by jampekka on Wednesday November 29, 2023 @08:27AM (#38459058)
At least you can do cross-OS BLE if you restrict to Chrome/Chromium. And do it very fast.

Cross-platform Bluetooth (and Bluetooth in general) is a world of pain anyway. Web Bluetooth API is a lot less painful than any other Bluetooth API I've encountered.

Of course there are cases that don't work in web. Does this mean it shouldn't be used for cases where web works?

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by mikewarot on Wednesday November 29, 2023 @10:26AM (#38460551)
I'm of the opposite opinion. Windows desktop GUI programming is almost trivial thanks to Lazarus. Getting a program written is just building the forms and hooking events and databases to them.

Here's a little utility I wrote to help me set up gear cutting machines. [1] I wrote it in about an hour, in Pascal/Lazarus, most of that time was writing it up for others.

I can't bring myself to try to dig through all the layers of cruft required to build a GUI version in a web app. Plus then I have to host it somewhere and worry/pay for that forever, which is nuts.

[1] https://github.com/mikewarot/GearFinder

Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by graynk on Wednesday November 29, 2023 @02:13PM (#38463819)
So we chose to make developer‘s life easier at the cost of inconveniencing the user. I think it should be the other way around
Re:Desktop GUI Is an Efficient and Fulfilling Way of Human-C... by stilltide on Wednesday November 29, 2023 @03:47PM (#38465076)
More like we choose to make developers more productive. Otherwise the application might not be available to the user and that would be considerably more inconvenient.