Hacker News new | ask | show | jobs
by red_admiral 808 days ago
I feel like every time CPU speeds double, someone comes up with a Web UI framework that has twice as much indirection. With 20x slower compute, we might not have UIs that fire off an event and maybe trigger an asynchronous network request every time you type a character in a box, for example.

Windows 95 could do a decently responsive desktop UI on an 80386. Coding was a lot less elegant in one way - C code that returns a HWND and all that - but with the number of levels of indirection and abstraction these days, we've made some things easier at the cost of making other things more obfuscated.

7 comments

I saw a talk about tigerbeetle the other day - which is a small, fast database for handling financial transactions that apparenty runs orders of magnitude faster than Postgres. The database binary has no dependencies and compiles to 500kb. Its authors were joking they could distribute it on floppy disks if they wanted.

It’s written in Zig, not C. But that style of programming is still available to us if we want it. Even in more modern languages.

Honestly I’m really tempted to try to throw together a 90s style fantasy desktop environment and widget library and make some apps for it. There’s something about that era of computing that feels great.

Keep in mind, the thing that matters most for tigerbeetle’s speed is they are domain specific. They know exactly upfront how data looks like. They don’t have to be general purpose.

The style of programming does work for general purpose computing, but their requirements enable a significant % of “orders of magnitude faster than postgress”.

While your take makes sense, I feel like even general purpose programming frameworks should be orders of magnitude faster for what they are doing.
Definitely! It's just your benefits aren't going to be "all" the orders of magnitude speedups, just some of them. And I agree, that's nothing to shy away from.
Yeah; and we have plenty of other general purpose databases which can run laps around postgres and sqlite.

There's plenty of optimisations postgres and friends leave on the table. Like, the postgres client driver could precompile queries and do query planning on behalf of the database. It would introduce some complexity, because the database would need to send information about the schema and layout at startup (and any time it changed). But that would remove a lot of unnecessary, repeated makework from the database process itself. Application servers are much easier to scale than database servers. And application servers could much more easily cache the query plan.

Weirdly, I think part of the problem is economic. I think there's a lot of very smart people around with the skills to dramatically improve the performance of databases like postgresql. Across the whole economy, it would be way cheaper to pay them to optimize the code than needing companies everywhere to rent and run additional database servers. But it might not be worth it for any individual company to fund the work themselves. Without coordination (ie, opensource funding), there's not enough money to hire performance engineers, and the work just doesn't happen.

Would odbc/jdbc protocols have to change to support client-planned queries?
Back when Java had just introduced Swing to supplement/complement AWT, I remember you had a set of components (that you could even style in different ways with themes), a fairly object-oriented approach, and with the open-source MiG layout manager (that still exists today) a powerful way of laying out forms with constraints to adapt to changing screen/window/font sizes. I feel like UI framework progress from Windows 3.1 to Swing+MiG was much greater than anything I've seen since.
I feel that way about the old Interface Builder for macos, back in the Xcode 3.x days. VB6 was pretty good too.
Yeah, the interface builders back then are also unsurpassed to this day. Much as I have my issues with VB as a language, the way you could build a GUI with a GUI was amazing. Better still, it worked back on school computers that of course didn't have any "programming" tools, but did come with MS office and the full VB "experience" installed for some reason.
Visual Studio's wpf editor and Avalonia are beyond vb6 interface builders!
Just curious, what is preventing people from creating something similar to VB6 and Delphi in modern days? Different underlying frameworks? But I'm sure VB6 still sort of works on Windows 10 (VBA).
The big problem is that nobody wants yet another platform-specific UI framework. Even Microsoft is using electron (or something like it) to build Microsoft Teams.

If you build a cross-platform UI framework, it'll probably end up looking a bit ugly and custom on every platform (eg Java Swing). Making a cross-platform UI toolkit that looks native everywhere is an insane amount of work, because different platforms have very different UI toolkits, with different built-in components and different platform conventions. This problem becomes 10x harder if you want to make it work on mobile as well.

Some people try anyway - and bless their cotton socks. But electron (and arguably Qt) are the closest we've got. And even then, most electron apps seem to be full of custom components.

In theory, nothing will stop you. In practice, nothing stopped GAMBAS (https://gambas.sourceforge.net/en/main.html), which can do a lot of what VB did.

Problem is, the multitude of platforms, screen sizes, capability sets etc. that we must support in practice make a very compelling case for a unified runtime, which ended up being the current web tech turducken clusterfuck we have today.

If the CPUs were slower, hovewer... one can only wish.

Depends what you mean by "similar to VB6/Delphi".

The VB6/Delphi era (called at the time RAD for Rapid Application Development) was oriented around proprietary UI and component frameworks. They were planned out a long way in advance and solved a lot of problems up front, but, they were tied to Windows and then you had to buy the dev tools on top.

These days people usually want to write web apps if they aren't doing mobile. The web as a UI framework is basically evolved rather than designed. The features you need to support RAD don't exist. Moreover the web UI community would view them as bad practice!

RAD tools were typified by a few things:

1. A standard way to define components that is statically reflectable (so you can populate property and event editors), and get documentation on the fly, etc.

2. MVC: a standard way to separate code from layout.

3. Layout management that's integrated with the component hierarchy.

4. A standard toolbox of high quality, high effort components.

5. A marketplace for components (which means they need to be distributable in binary form).

The web has none of this and isn't going to any time soon. For example, there's no agreement on how components work. React has one or more different solutions, Web Components is a different one, Vue yet another. MVC has been abandoned: React doesn't know anything about that. Code and layout are intermingled together. JavaScript is dynamically typed, largely reflection-free language. You can't automatically work out what the props are for a React component short of parsing the source code. You can't easily distribute proprietary components either because there's no way to enforce licensing (so a lot of users wouldn't pay, in reality).

And then there's the components. Browsers don't provide good enough components out of the box, unlike Windows-oriented RAD tools, so devs have to invent their own. Then React makes things worse by conflating theming with the component library. The result is that every web app has its own unique set of widgets with its own unique set of limitations and bugs, very few of which ever reach a high quality level. Widget development is expensive, which is why RAD tooling centralized it and supported a marketplace, so devs could amortize out the cost of writing widgets across many projects. The whole React/Jetpack Compose approach basically spurns all of that and says if you want to change the way your app looks you get to redevelop the widgets from scratch. And everyone does want that, so there are floods of duplicated work that's open sourced and then abandoned, but nothing ever gets critical mass.

> Honestly I’m really tempted to try to throw together a 90s style fantasy desktop environment and widget library and make some apps for it. There’s something about that era of computing that feels great.

SerenityOS might be exactly what you're looking for. Join the community and make some apps, it's great (both the community and the OS/dev experience)!

Is there any way to run something like "serenity's WM and file manager, but on my favorite linux distro?" Or is it all more tightly coupled than that?
It's a Unix like OS with great separation of concerns. There probably is a way - their browser runs on Linux - but I don't think anyone has done it yet. Could be a fun project to look into!
In 2007 I put together a bunch of servers running openSUSE 10.2. They run some specialized application software that's version-dependent and is unlikely to ever be upgraded. The working network is not connected to the internet, so there's no reason to upgrade the OS.

They're full KDE installs, and openSUSE 10.2 wasn't a lightweight distribution in its day. But now, even running in VMs, UI and network response are noticeablly snappy, and are sparing of resources by modern standards.

Do you think you'd write your 90s style widget set and desktop environment in Rust, or do you think Rust itself tends toward bloat (in non-embedded applications)? I know you use Rust in other projects, which is why I'm asking about that language specifically.
Please do. I'm also wondering why no one created something similar to VB6 and Delphi.

  if [ "$os" = "Darwin" ]; then
    arch="universal"
    os="macos"
  elif [ "$os" = "Linux" ]; then
    os="linux"
  else
    echo "Unsupported OS."
   exit 1
  fi
This is nothing to emulate.
Why not? Does everything really need to be built in a cross platform way? I feel like that’s how we got into this mess.
Yes, bugs are often found by running the same code on similar but not identical platforms. We've had this conversation multiple times.

https://news.ycombinator.com/item?id=28978086

What mess are we in because of POSIX?

I’m talking about the mess of electron and friends. I’ve spoken to engineers who work on it. From their point of view, it’s the only sane way to build software that works across multiple operating systems.

The nice thing about windows and macOS back in the day was that the programs we ran were all written with the same native UI toolkit. All the controls matched between applications. Applications were small and efficient - binary sizes and memory usage were in the megabyte range. Any program written like that today starts up instantly, and is incredibly responsive.

But last I checked, Hello world in electron is ginormous. It uses about 100mb of memory. It takes time to start up. Vscode and Spotify are great but they don’t look or feel native. It is legitimately great that people now ship apps for Linux. But we’ve lost platform cohesion in the trade.

So, so what if tigerbeetle is written for Linux? I’m ok with the developers choosing not to pay the cross platform tax.

That's just the codepath from bootstrap.sh that downloads the binaries. I don't know if it will compile and run on, say, FreeBSD. It's quite possible no one tried.
I did, but there are literal compile-time checks for various platforms.

    pub fn monotonic(self: *Self) u64 {
        const m = blk: {
            if (is_windows) break :blk monotonic_windows();
            if (is_darwin) break :blk monotonic_darwin();
            if (is_linux) break :blk monotonic_linux();
            @compileError("unsupported OS");
        };
That genuinely seems platform-specific. Should be easy enough to write a patch to add support for $other_system.
According to the talk I watched, tigerbeetle makes heavy use of io_uring on linux - which isn't part of POSIX.

Adding freebsd support should be pretty easy. If it supports darwin, it'll probably already have an implementation built on top of freebsd's kqueue. Its probably just a case of wiring it up to use kqueue when built for freebsd.

> Honestly I’m really tempted to try to throw together a 90s style fantasy desktop environment and widget library and make some apps for it. There’s something about that era of computing that feels great.

If you're interested in that, you should definitely check out Serenity OS!

VB6 had intellisense. sure it was much less powerful than today's, but you had a project with a dozen classes, and when you typed the name of an instance variable and then hit ".", it would immediately show you a list of accessible members of the according class and update the preselected member as you started typing. This was absolutely immediate, on a 133mhz machine with 32mb RAM. Even on 66mhz it was still usable.

I remember switching to VB.NET on a 600mhz machine and the IDE was a sluggish piece of garbage.

Every IDE is a sluggish piece of garbage after Delphi 7.
I'm curious if you've used Lazarus and what you think about it. I have not used enough similar IDEs to compare it (or maybe just forgotten how it was) and didn't have access to Borland tools back in the day. One crazy thing I remember about Lazarus is how it can compile the IDE quite fast (given its codebase size) when installing plug-ins.
Unfortunately no, had no use case for it in an industry dominated by Python and C++. Wouldn't be surprised if Lazarus is very fast and pleasant to use, and I think the problem with more popular IDEs lies in underlying technology: C++ is traditionally very slow to compile and analyze, and many popular languages are too dynamic for reliable autocompletion to be feasible. When I briefly worked with C# and Java in 2000s the IDEs were very much fully functional (compared to C++ at the time), but sluggish enough to be unpleasant without a powerful PC which I did not have — and Delphi ran fast on cheap hardware.
I'm used to newer computers, so Visual Studio 2008 was my favorite Visual Studio. With VS 2010 and later, Microsoft decided to scrap the existing Win32 based UI and rewrite it in WPF, which made it take 20 seconds to start instead of less than a second. Even after it's started, it's far less responsive than 2008. If only Microsoft offered a "Visual Studio 2008 but with modern standards support" product...
It’s an evolving economics problem. Very few (I mean super extremely few) people really know how the web UI works without a framework and there is no incentive to know this because the more skilled a person becomes in that regard the less employable they become.

As a 15 year former JavaScript developer I can see that things are changing in this regard with hiring slowing down, but there remains close to no incentive to be good at any of this. Even if you are good at this and defy all extreme expectations by finding a job that values bleeding edge performance over hiring you won’t be paid any more for the rarity of your talent/experience so why bother?

Doesn't it make you the go-to person when something goes wrong, and someone has to debug it?

My own experience from a time at a SpringBoot/iBATIS/Hibernate etc. shop (so server-side not UI side) is that it's all well and good running on "rocket fuel" as the consultants say, until something goes wrong. Then at some point you need the person who understands HTTP and SQL and other antique stuff to diagnose the problem, even if you can fix it at the abstraction layer.

One of the problems we had one day, was that a particular script "just wasn't working" and it turned out the file was being sent correctly, but with the content-type set to "text/html" by mistake because someone's "clever trick" interfered with SpringBoot's "magic" so the content-type detection wasn't running the way you'd want. Easy to fix, but you need to know what's going on in the first place.

Over time I also developed a feel for code smells of the form `return SomeItemDAO.fetchAll().size()` which runs just fine on the test server with a few thousand items, then you deploy it to prod where there's tens of millions and the database is on a different machine. It turns out SELECT COUNT is a thing!

> Doesn't it make you the go-to person when something goes wrong, and someone has to debug it?

Assuming anyone cares enough. Alternative approaches include, ignoring the problem, working around it, or changing business requirements so that the feature isn't available anymore.

There are a lot of people in the industry that just throw up their hands at roadblocks they can't solve and say something is not technically possible. These people include "tech leads" or other high-level software roles at companies.

> These people include "tech leads"

I have known a tech lead, one-self a java developer, who could not compile java code to class/ jar file that could be added to a docker layer in a pipeline.

There are people who do care about that, but it’s astonishingly rare. Just consider it abandoned knowledge. Most of the people who continue to care about these things do so in open source contributions far away from their employment.

As a proof occasionally somebody will post something on HN about performance (asking for guidance, showing off a refactor, claiming performance is a critical must, whatever). I show them how to achieve load times of less than 100ms on a OS like GUI with full state restoration and the feedback is always the same. Either they can’t hire anybody who is capable of following that guidance or the juice isn’t worth the squeeze. Nothing in the guidance is challenging. It’s just not framework bullshit.

> they can’t hire anybody who is capable of following that guidance

This is the main constraint when designing some solutions. Oftentimes I know the best path (or that something deemed impossible is completely doable), but it might be arcane knowledge and I would be the only one to know how it would work and be responsible to keep it working.

Bus factor of one strikes this right away, unless there are no alternatives.

Again, it’s an economics problem. More specifically what you are addressing is not an availability problem, as everyone most commonly believes, but a selection problem.

Seriously, think about this logically. The compile target of the browser is the DOM. What is it these developers are so deathly afraid of: the DOM. Yes, it is raw emotional fear processed in the amygdala, qualified with poorly formed bullshit excuses. So, what about this induces fear? It’s not the technical challenge, because it’s not that challenging and easily taught to non-developers. I know this from experience. That’s how I know it’s a selection problem.

It’s kinda like adding lanes on the freeway: for a time traffic is nice but people get used to it and then more people start driving and it becomes just as congested as it was before.
Yes, but Jevons paradox only says usage goes up. That usage could have gone to things that help with productivity of the end user rather than going to sluggish frameworks.
Good observation. I believe the name for that is "induced demand".
No, that's not what induced demand is.

Induced demand is the idea that if you upgrade things, people will use it more (duh). (And it will need upgrading again shortly)

The post you're replying to is just how benefits of improvements scale off with time.

I do wonder about this often. Are these new UI frameworks iterating upwards towards some unknown featureset archetype, where if given another 10-20 years, the designers will say "Okay, we've reached diminishing feature returns, let's pack it up and optimize"

Or, are we simply re-inventing the wheel each time, where the set of features over the last few decades really haven't change that much or cycles through featureset phases.

I would say, to go with the metaphor, that none of our wheels are close to round yet, and every now and again someone invents a new wheel that has a different kind of bump.

Concretely, "shadow DOM", reactive (web) components and js frameworks etc. etc. are all ways of trying to get a set of rich UI components (like we're used to from desktop applications) into an environment that was originally built for static text pages, and has been expanded by patchwork ever since. DOM updates are slow and cause flickering because the original model was you submit a form and the entire page reloads; updating part of the page in response to an asynchronous request or a local event wasn't in the original design space, and every solution we've tacked on so far sucks in a slightly different way. Not helped by the complexity of being able to dynamically change the layout and size of every single element - CSS is incredibly powerful, but setting a button to have a 1px border only on hover for example has a tendency to make other page elements "jiggle" in ways you don't want.

> Or, are we simply re-inventing the wheel each time, where the set of features over the last few decades really haven't change that much or cycles through featureset phases.

The problem space is much larger now than it used to be. 20 years ago, you didn't care about things like responsive design, accessibility, fractional scaling, even internationalization was basic/non-existent. There's a long tail of features (often extremely complex, like accessibility) which are not immediately obvious for an english speaker with normal vision staring at a standard sized display.

Microsoft specifically cared about all that, way more than 20 years ago - Windows, for all the criticism it takes, from early days had internationalisation (they wanted to sell across the world after all), accessibility features, ways to adapt to different screen and DPI sizes etc. I think Explorer windows since at least Win 98 did something responsive-ish in that various side bars/panels would disappear if you made the window narrow enough. Of course, the icons would rearrange themselves into fewer or more columns as you resized the window too.
I would expect some overhead, but none of the features you describe seem to justify performance hit apps have taken.
Performance is a feature just like any other. Customers are looking for a good combination of features, including performance. At some point, the feature (in this case performance) is good enough, and it doesn't make economical sense to improve it.
> Or, are we simply re-inventing the wheel each time,

This is how it has been since I've been in the industry (2005). it's part of why I got out of web development; it felt like a whole lot of relearning how to do the same thing every few years. At first, there was incremental feature gains, but after a while, it felt like newer frameworks or approaches were a functional step back (i.e., NoSQL, the fact that it eventually came to stand for "not only SQL" tells all).

"It doesn't matter how much faster you make the hardware, the software guys will piss it away and then some more." - Unknown

Edit: Thanks to the other comments, I can see it's a crude re-stating of Wirth's Law [0]

0. https://en.wikipedia.org/wiki/Wirth%27s_law

Jevon's Paradox applied to compute

https://en.m.wikipedia.org/wiki/Jevons_paradox

And its called Wirth's law: "What Andy [Grove] gives, Bill [Gates] takes away".

https://en.wikipedia.org/wiki/Wirth%27s_law