Hacker News new | ask | show | jobs
by rendaw 11 days ago
Throwing in my vote... I've been doing everything with wasm-bindgen/web-sys, i.e. just doing my UIs in html, and for 99% that's what I'd want anyways. Web UIs are portable, remotely accessible, and don't require installation on each client.

For the small percent that's left where speed is critical, I've just been using wgpu and wgsl-bindgen directly.

I can't think of what I'd want a native UI solution for. And then having to deal with porting it to iOS, Android, Windows, Mac etc, dealing with app stores (3+?) submissions, developer fees, rejections... vs just using HTML which works on all platforms. I don't think I'd use a native UI even if there was one. Not that HTML is great by any stretch...

(I made Sunwet, this is what my stuff looks like: https://github.com/andrewbaxter/sunwet )

10 comments

Web UI is fine for web applications, obviously.

But for desktop applications it is bloated, a big attack surface.

HTML/CSS is made for online documents, and using it for applications is a bit hack that happen to work, but hides a huge ton of complexity behind frameworks and frameworks of frameworks with leaky abstractions and each their own caveat.

> a big attack surface

Wdym? At least web apps are sandboxed by default in contrast to native.

Depends on which OS we're talking about.
Under which OS would a website not be sandboxed? It's the browser doing the sandboxing, not the OS.
I am talking about native applications.
web UI is slow, this is only reason when I don't it.
I'm not a frontend developer, but seems fast to me. I'm surprised that the UI portion of this example takes so little CPU: https://youtu.be/7k0JNT6itaI

Now, the rest of the DSP code sure is faster in native.

What are examples where web UI is too slow for you?

Or do you mean large apps written in JS, which is a different topic?

Slow means many: * long program launch times * inconsistent frame rates during runtime * noticeable lag in user interaction
That's neither examples nor a clarification if you're talking about JS or WASM.
No specific examples. Just general GUI apps.
I am not much of a GUI user, or programmer, but I have used a lot of GUI tool kits, mostly debugging and/or extending other's work

HTML5 is the sanest for me. I can actually find where code executes, tooling using browsers (Firefox or Chromium) excellent and the declarative layout works well

The hours and hours I spent chasing the executing code in Dart/Flutter and, oh my aching head, in SwiftUI made me hate those with passion

I get that it is unsuitable for desktop programmes, for many good reasons, but it is so much better to modify.

I can't think of what I'd want a native UI solution for.

A proper first-party LLM app for ChatGPT/Claude that doesn’t buckle under the weight of large threads.

You can accomplish this with web without much issue.
> I can't think of what I'd want a native UI solution for.

So that your software is actually pleasant to use for your users. UIs built on HTML universally suck compared to native UIs.

> I can't think of what I'd want a native UI solution for.

Because then your UI will work the way users of the platform expect it to.

> wgsl-bindgen

Oh I didn't know about this, it looks great! If it works as well as it seems to, that would be a huge ergonomic boost to using wgpu. Currently all my wgpu code has those fragile feeling pipeline layout definitions scattered around and changing the data layout is always a pain.

I wish there were even more checking here still, but I think wgsl-bindgen is a huge improvement. I definitely recommend it!
its only going to get better from here. Its a great tool.
Universal technologies are increasingly becoming more desirable for devs the more I read about them.
> I can't think of what I'd want a native UI solution for. And then having to deal with porting it to iOS, Android, Windows, Mac etc, dealing with app stores (3+?) submissions, developer fees, rejections

Not everything is yet another shitty b2c "app".

There are whole industries where cross-platform support is irrelevant, as paying customers just keep using Windows.

True! My position is probably biased because I'm making stuff where I want maximum client compatibility. That's a good point.
Sunwet looks like a lot of fun! I've put it on my TODO list to play with. Maybe I can use it to organize my ebooks in an undo-friendly way
saving this comment, this echos my own thinking, html is not great but its better than dealing with all those things you listed.
Second this. Html is just so darn universal now