News for hackers. Stuff that matters.
Re:Muon: GPU Based Electron on a Diet by 0x457 on Sunday October 02, 2022 @08:34PM (#33062000)
Nah, we ended up with Electron because we have more front-end devs than C++/C#/ObjC devs and because doing layout in HTML + CSS is a million times easier than in native frameworks (AppKit and UIKit aside, those are nice).

It being cross-platform is probably secondary.

Re:Muon: GPU Based Electron on a Diet by semireg on Sunday October 02, 2022 @09:57PM (#33062604)
I was a mobile dev, mostly native iOS and some android/kotlin, for better than 10 years. I still maintain a dozen apps from my days as a full time consultant.

Before consulting I did web dev in early 2000s when the stack was LAMP and JavaScript felt like something that would never mature into anything. Hell, I was in my late teens so the feeling was likely mutual.

All this to say, good god, autolayout and storyboards and stack views. Last Friday I spent TWO HOURS troubleshooting why a UILabel wouldn’t word wrap inside two UIStackViews.

I’m so grateful for electron. It’s allowed me to become an indie dev and embrace/leverage react and the entire JS ecosystem to bootstrap a successful company.

My indie success would never have been possible if it wasn’t for these “inefficient” dev/deployment desktop stacks. And if they allow lowly old me to sell software to thousands of users around the world then they are doing something right. I hate to say it, but they really allow me to be 10x of what I’d be solo on mobile. Electron/React has that much potential when focused on solving a few painful tasks for my end users.

Re:Muon: GPU Based Electron on a Diet by mrich on Monday October 03, 2022 @08:15PM (#33075317)
> JavaScript felt like something that would never mature into anything. Hell, I was in my late teens so the feeling was likely mutual.

Just want to say thanks for this gem ;)

Re:Muon: GPU Based Electron on a Diet by int_19h on Monday October 03, 2022 @04:16AM (#33064800)
I agree with the first part, but not with the second. Doing layout in e.g. WPF or QML was way easier than anything we had in HTML until flexbox became a thing - which is to say, for many years. Simply because those frameworks were designed from the ground up around laying out widgets, while HTML was oriented more towards document-like flow for a very long time.
Re:Muon: GPU Based Electron on a Diet by nicoburns on Monday October 03, 2022 @05:29AM (#33065202)
Sure, but we do have flexbox now. And CSS grid. And have done for over a decade.
Re:Muon: GPU Based Electron on a Diet by int_19h on Monday October 03, 2022 @09:29PM (#33075816)
The question was why HTML-based UI became popular. And that predates widespread support for all these things.
Re:Muon: GPU Based Electron on a Diet by 0x457 on Thursday October 06, 2022 @03:00PM (#33112491)
Flexbox was supported in chrome since Chrome 21 (2012). Electron initial release was in 2013.

To make an electron app, you only care about that your chrome runtime support.

Re:Muon: GPU Based Electron on a Diet by 0x457 on Thursday October 06, 2022 @03:03PM (#33112545)
Yeah, but flexbox came around 2012 and Electron came around 2013. Web UI weren't that popular until electron.

WPF is well, windows only. QML is C++ or python and didn't look native at all, but it also didn't look very pretty either. With HTML + CSS you can easily make an eye candy.

Re:Muon: GPU Based Electron on a Diet by mysterydip on Sunday October 02, 2022 @09:10PM (#33062242)
I agree with your first bit, but so far have been unable to find layout tools for HTML/CSS that compare to the ease of the VB6-era drag-n-drop component editor. I'd love to know of one, though.
Re:Muon: GPU Based Electron on a Diet by amaranth on Sunday October 02, 2022 @09:37PM (#33062445)
Those tools didn't work well for things that need to adjust to different screen/window sizes or even for localization causing text elements to change size. For that kind of stuff you need some kind of dynamic layout like springs & struts, flexbox, etc. I think Qt and XCode have drag and drop UI designers for layout systems that work that way, instead of picking an exact position for things you pick their location and size relative to their contents and things around them. I find just using CSS to be easier to think about than those but they're nice for trying things out.
Re:Muon: GPU Based Electron on a Diet by bitwize on Sunday October 02, 2022 @11:23PM (#33063147)
I find it's hard to rat-wrestle your way to a GUI that adapts nicely to different window sizes, resolutions, etc. Xcode probably comes the closest but I haven't tried it in years. I know there are purists who think "well, it's a VISUAL interface so you have to lay it out VISUALLY!" but this is actually trickier than you might think when you have to render the UI in a different context from when you created it.

I've found it easier just to do declarative layout. Tcl/Tk does this real well, and has since the early/mid 90s. I know that Tk uses imperative commands to build out the UI scene graph but it's effectively declarative. Tcl/Tk is pretty much VB done Unix style.

Re:Muon: GPU Based Electron on a Diet by pjmlp on Monday October 03, 2022 @09:31AM (#33067262)
Except they always supported flexible layouts as well, no need for absolute positioning.
Re:Muon: GPU Based Electron on a Diet by lmm on Monday October 03, 2022 @01:10AM (#33063675)
> doing layout in HTML + CSS is a million times easier than in native frameworks

Nonsense. Doing layout in Qt is much, much nicer than HTML/CSS. If you could just push a button and get executables for all the major platforms, by default, like you can with Electron, it would be winning.

Re:Muon: GPU Based Electron on a Diet by JCWasmx86 on Monday October 03, 2022 @12:24AM (#33063454)
> doing layout in HTML + CSS is a million times easier than in native frameworks

I agree with your comment, except here: Doing layout in GTK is much easier than using HTML. Especially using Blueprint[0] you don't even have to touch .ui files. And constructing the GUI using code is possible, too.

At least the few things I did in HTML were a lot more difficult than they would have been in GTK.

[0] https://gitlab.gnome.org/jwestman/blueprint-compiler/

Re:Muon: GPU Based Electron on a Diet by 0x457 on Thursday October 06, 2022 @03:04PM (#33112558)
Yeah, but no one wants to look at GTK apps.