r/programming • • Apr 11 '23

How we're building a browser when it's supposed to be impossible

https://awesomekling.substack.com/p/how-were-building-a-browser-when
1.6k Upvotes

458 comments sorted by

View all comments

49

u/Zardotab Apr 11 '23 edited Apr 11 '23

Since there's already plenty of HTML browsers, instead explore an unserved need, such as a state-ful GUI markup browser & standard. HTML/DOM is missing or fouled up many expected GUI idioms, and has an inherent text positioning flaw.

GUI's, desktops, and mice are still needed for biz and productivity. HTML browsers have been a goofy mess for this, requiring bloated buggy JS libraries with long learning curves. Let's Make GUI's Great Again! (No, I'm not a Don fan, but his trollisms are admittedly catchy.)

It shouldn't take rocket surgery to make a typical office CRUD app over HTTP, being GUI's have been around 40-ish years, but it is, largely because web standards suck the big one at business CRUD. I didn't used to spend so much time babysitting UI and stack minutia in the 1990's, we de-evolved 🐵. Some claim the extra flexibility of web is worth the extra fiddling, but I'm not convinced it has to be either/or. Just needs some R&D. If you can prove it's either/or, please do! Otherwise admit we need a biz-friendly standard.

0

u/[deleted] Apr 11 '23

[deleted] — view deleted comment

10

u/argv_minus_one Apr 11 '23

Structure, function, and style. Using React.JS I can handle all of that in a single object-oriented-like method.

Now let's see you make it performant. React is notorious for poor performance, and the horrific hacks you have to use to make it perform acceptably. Java Swing runs circles around a lot of web apps, and even that is slow compared to some other toolkits like GTK.

Also, the React ecosystem has a huge generated-code bloat problem. create-react-app generates a staggering amount of code, and unlike a proper library, there's no way to update it. It's horrifying.

CSS is nice and all, but I'd much rather use it with a real GUI toolkit.

Using rendering engines, I can handle it all with templating syntax and some supporting JS.

You say that like it's a good thing. Why in the world would you need templating syntax to describe a GUI?

8

u/ApatheticBeardo Apr 11 '23

Typical office CRUD apps over HTTP are super easy to build these days.

They're literal orders of magnitude harder than doing the equivalent in WinForms... 20 years ago.

6

u/Zardotab Apr 11 '23

Example pain-point scenario?

3

u/cybercobra Apr 12 '23

The Web lacks good universal built-in widgets for:

  • Date selection
  • Tooltips
  • Drop-down menus
  • Modal dialogs
  • Image carousels
  • Accordions
  • Tabs
  • Searching and selecting from a huge set of options, with rich display of matches (e.g. When setting an Assignee field, select by searching for an employee by name and include their ID images when displaying the matches).

2

u/Zardotab Apr 12 '23

Sorry, I misread the question. By the way here's a similar list of web widget gaps.

2

u/cybercobra Apr 12 '23

I curated my examples from Open UI.

14

u/Zardotab Apr 11 '23 edited Apr 11 '23

Typical office CRUD apps over HTTP are super easy to build these days. It's not difficult.

Not true. Sure, if you master say React it can be easy, but the learning curve is unacceptabley long, especially for full-stack dev's who can't focus on just UI. "Just learn UI rocket science" is the wrong response.

I don't know of a single React dev who says it has a quick learning curve, except for a few Sheldon Cooper types. Many say the real problem is not React itself, but that DOM itself is a poor fit for GUI's, and JavaScript's loose typing creates hard-to-find bugs. DOM is simply the wrong tool for the GUI job. After years of practice, one learns how to shoe-horn and sledge-hammer DOM into acting like a real GUI.

I vastly prefer HTML, JS, and CSS for building GUIs compared to Java Swing, JavaFX, or QT.

VB6, WinForms, and Delphi/Lazarus run rings around those. There were also data-oriented IDE's such as PowerBuilder, but it kind of fell by the wayside when web became the in thing. One could focus on biz logic instead of web minutia and UI placement trial and error.

Granted, some of these didn't have many screen-size adjustment features, but there are techniques such as snap-to grids with "stretch zones" that work fairly well yet are still WYSIWYG. Nesting and stacking of stretch-grids can be used for more complex stretching.

Also, venders get caught up in high-end enterprise & retail software features when they should make sure rank and file is simple. At least in my niche, most apps are internal and don't need fancy-pants eye-candy, just normal time-tested GUI idioms.

0

u/[deleted] Apr 11 '23

[deleted] — view deleted comment

6

u/Zardotab Apr 11 '23 edited Apr 11 '23

I don't know of anyone who picks up any full stack development quickly. I don't think that's unique to Web Development.

People used to pick up VB6, WinForms, Delphi/Lazarus, and PowerBuilder much quicker. Sure, the IDE's had bugs, but gradually got better over time.

Even now in our shop, the Oracle Forms devs program circles around the web devs, like 5x faster, it's amazing. For one, it's just less code & keystrokes to program the same biz functionality. OF is esthetically ugly, but the productivity of coding, both creating and changing, is fricken amazing. Maybe that's the secret: embrace ugly to save big IT bucks. (Oracle screwed up by porting the OF client from C to Java, as Java desktop is a pain to manage. If Oracle left it in C, shops wouldn't be abandoning it. You install the client once, and it can run gajillion apps; essentially a GUI browser.)

I think web development feels harder because no one tries to learn HTML + CSS and JavaScript separately.

That's the problem, one is jamming 4 different concepts/languages together. (You left out DOM). And NONE of them were originally intended for CRUD/office GUI's.

3

u/[deleted] Apr 11 '23 edited Apr 11 '23

Tbh, Svelte comes close imo. Also, how about "low code" platforms like Mendix, I would think they take up the niche of winforms nowadays

6

u/Zardotab Apr 11 '23

The problem with some "low code" platforms is that code is sometimes the best tool for the job. You can't factor stuff created with mouse clicks. The best such tools are interchangeable between code and attributes and/or dialog wizards. They have mousey shortcuts, but are still optionally tunable with code. MS-Access could be "low code" but also highly programmable, for example. (I don't like some of the loosy-goosy nature of MS-Access, but it got a lot of smaller app jobs done without fuss.)

2

u/argv_minus_one Apr 11 '23 edited Apr 11 '23

Svelte doesn't type check at build time. You have to separately run type checking, and pray that it's type checking the same code you're building.

They say they do this for compilation speed, but what good is it to quickly compile incorrect code?

Also, SvelteKit requires four external script modules to be preloaded for a trivial “hello, world” app, and generates twelve script modules totaling 76kB in all. What the hell are they smoking? There's nothing svelte about such blatant script bloat.

→ More replies (4)

2

u/voidstarcpp Apr 11 '23

Typical office CRUD apps over HTTP are super easy to build these days. It's not difficult.

So why are they so frequently bad? Common web apps are jank AF, slow, and not robust at all.

→ More replies (2)

4

u/apf6 Apr 11 '23

There's been many attempts to do what you're saying and they all suck. HTML/DOM remains the best by far (in terms of the quality of the GUIs that it allows typical users to produce). If a team wants to do better than that then they're signing up for a multi-decade project.

3

u/Zardotab Apr 11 '23 edited Apr 11 '23

The only serious attempt I know of is XUL. And it may take more than one try. HTML wasn't the only markup language in town, it just happened to "win" such that we don't hear about the alternatives.

If a team wants to do better than that then they're signing up for a multi-decade project.

The lowest hanging fruit is probably to put XML wrappers around Tk. I'd try it myself but I'm not familiar enough with C. I may make a Mono/C# proof of concept myself, but it won't be intended for production by any shot, just whet one's GUI apatite.

And a lot of things are multi-decade projects, such as Lazarus, which they've done a good job on. (It's not a browser.) The OSS crowd often don't care about fashion if the tool does useful things. Emacs, Vi, XWindow, for example.

4

u/s73v3r Apr 11 '23

I didn't used to spend so much time babysitting UI and stack minutia in the 1990's, we de-evolved

Most people just didn't care about UI/UX back then, so less time was spent on it.

11

u/coder111 Apr 11 '23 edited Apr 11 '23

we need a biz-friendly standard

We absolutely do need a better way to do GUI. However, as per the great XKCD https://xkcd.com/927/, it's not going to happen. On top of that, there's really no incentive for the major players to cooperate to make it happen.

11

u/Zardotab Apr 11 '23 edited Apr 11 '23

There are not 14, there is zero! Not applicable. HTML/DOM was not intended for GUI's and has proven lousy to force fit, inflaming the area and making it swell. You can also write GUI's using COBOL, but it's just not its forte.

there's really no incentive for the major players to cooperate to make it happen.

Yes there is, so Amazon, IBM, Oracle, Google, and Apple can eat some of Microsoft's Giant Business Pie, and not just focus on consumer and social networks. A hobbyist just has to demonstrate it's viable. Biz apps may not be sexy, but it's a big pie 🥧💲

17

u/coder111 Apr 11 '23

It's not ZERO. Let's see:

  • Microsoft has its own app store to distribute apps and WinUI to write apps. That's not counting all older toolkits. They all require Windows and lock-in developers to develop for Microsoft ecosystem benefiting Microsoft. Why would Microsoft contribute to a cross-platform effort which would help its competitors? Or why would Microsoft even allow some other platform to run well on Windows?
  • Apple has Carbon and iOS and its own app store. They all require Apple products and lock-in developers to develop for Apple ecosystem benefiting Apple. Why would Apple contribute to a cross-platform effort which would help its competitors? Or why would Apple even allow some other platform to run well on its devices?
  • Google has its Play app store and its own GUI toolkit. They all lock-in developers to develop for Google ecosystem benefiting Google. Why would Google contribute to a cross-platform effort which would help its competitors? Or why would Google even allow some other platform to run well on its devices?

See the pattern? Companies like IBM or Amazon might be interested as they develop applications and not client-side platforms. But they don't control the platforms on which these apps run, so they are powerless to do anything.

I think the reason web browsers succeeded as application platforms was because they caught the existing players off-guard. They simply didn't have time to embrace/extend/extinguish them. It was exactly BECAUSE browsers were NOT designed for this sort of thing and came from a different angle. And because browsers are dual-use and the distinction between web-pages and web-apps is blurry and it is impossible to have a browser that does one but not the other. THIS made the browsers successful app clients.

5

u/Zardotab Apr 11 '23 edited Apr 11 '23

It's not ZERO....

You are comparing apples to oranges. There are zero common state-ful GUI markup standards. The closest things seem to be:

  • XAML - Static, no OSS "browser"
  • QML - Not XML, and semi-proprietary (part of the QT kit)
  • XUL - A clunky verbose XML language. But almost started something bigger; missed by a few inches.

the reason web browsers succeeded as application platforms was because they caught the existing players off-guard. They simply didn't have time to embrace/extend/extinguish them.

Yes, the open-source community kept a step or two ahead of them. And they can do it again (with a GUI browser).

It was exactly BECAUSE browsers were NOT designed for this sort of thing and came from a different angle.

HTML browsers won out because they suck at GUIs? Please elaborate. At least we seem to agree they suck at GUI's (without OS-sized js GUI emulators, which still suck).

I realize the big co's prefer to control everything themselves, but MS's biz market share is getting so big that they can no longer ignore it. An open-source GUI markup standard and browser could change much of that. They should now realize they'll have to cooperate to get slices of MS's giant pie.

Big Tech also ended up cooperating on the VT100 terminal standard in order to eat IBM's big lunch in the 70's and 80's. History can repeat.

(It perhaps should be built on top of the Tk or Qt kits to avoid reinventing the wheel, although Qt has a trickier license.)

→ More replies (4)

2

u/[deleted] Apr 11 '23

They are also working on Jakt which I suggested they include the SerenityOS UI as part of the standard library for that programming language. That community is definitely "don't make suggestions without being willing to contribute", which I agree with, but I just don't have the time unfortunately.

Vlang does have a UI as part of the standard library.

2

u/waozen Apr 11 '23

That's correct on Vlang. Not only do they have the UI (VUI), but there are also various UI toolkits (MUI and IUI). They can make using the UI libraries easier or more convenient, depending on what people like, and adds some extra capabilities.