Live data from Hacker News

WebGPU Fundamentals

webgpufundamentals.org

181–190 of 211 posts

Re: WebGPU Fundamentals

#181
post #73

I wish they had kept the c/c++ syntax style for WGSL, the rust syntax is just awful and alienating.

Not sure how it remotely looks “awful and alienating”. It looks like basically every recent language to me (swift/kotlin/rust/typescript). I feel like you just saw something that has the same numeric type names as Rust and jumped to conclusions.

> swift/kotlin/rust/typescrip

I don't use any of these and because it just

Re: WebGPU Fundamentals

#183
post #73

I wish they had kept the c/c++ syntax style for WGSL, the rust syntax is just awful and alienating.

I much prefer the new syntax. The C based shader languages always end up in some kind of uncanny valley where it looks like C and C++ but behaves completely differently. It's not exactly Rust either, the @annotations aren't written like that in Rust for example. The let-syntax is closer to Javascript with type annotations, so that makes more sense for web programming than doing C style variable definitions. Using let…

I feel like they made a lot of weird choices like let being the new const, while still having constants, that won’t be confusing at all. While disappointing I will try and port over some of my webgl stuff and see how I feel about it.

Re: WebGPU Fundamentals

#184

Earlier quoted context omitted.

Browsers are just “standardised” OS at this point. Really, what is the difference? It seems to me that people basically wants a 1 to 1 mapping between every OS feature to browsers. I wouldn’t be surprised if this standard will fall apart in the next decade once Chrome runs everything. That is to say Chrome is the standard. I am already seeing websites drop support for Firefox and won’t even load using it.

The difference is that it is not a "standardized" OS interface. Rather it's a complex layer on top of operating systems offering dumbed down and less performant versions of what is available all of which is interfaced by a dynamic and not so performant language. If it was something like a modern POSIX I don't think you'd have much complaining. But it's a lot heavier than that.

In the context of this thread it is enough to compare Web 3D capabilities and tooling, and how lacking they are when compared against with the native conterparts.

Re: WebGPU Fundamentals

#185
post #19

Question for discussion: when have we reached the point where the Browser Feature-creep is too much and we say "okay, a browser probably doesn't need this"? Because after seeing WebUSB and WebGPU I think my personal limit has been reached.

> Because after seeing WebUSB and WebGPU I think my personal limit has been reached. Sure, but where do you draw the line really? For me, having WebUSB and WebMIDI for example is useful, I want to be able to interact with synths over MIDI in the browser, or be able to access other accessories. I also love the idea of GPU access, so my personal limit has not been reached. Multiply this by every vendor, developer and u…

Couldnt there be plugins for these things?

Re: WebGPU Fundamentals

#187
post #153
post #95

Earlier quoted context omitted.

> Free yourself from the notion that a web browser purely browses The Web. Free yourself from the notion that a web browser should do anything more than browsing the web. native applications have existed for decades, no reason to bloat the scope of a browser.

I wish it wasn't true either. Seeing a semi-technical acquaintance use in-browser software for daily productive work hurts my programmer's soul. It's alright for some light things, like vacation planning, but remote desktop or an IDE... Then there's that other scourge of Electron-like apps with gigantic memory budgets and all. I have resigned to throwing more hardware at it when I can't guarantee a lighter replacemen…

I think I would rather have a bloated (but reasonably fast and featureful) browser, than clog my computer with native apps for every app out there. Most of the apps doesnt need much power anyway.

I really dont want to see a repeat of phone apps for every company I interact with.

Re: WebGPU Fundamentals

#188
post #116
post #101

This looks heavily geared towards graphics. I’m interested in the compute capabilities of WebGPU to build an in-browser simulator (e.g. physics/quantum). Anyone know of any good resources for that? (Samples, best practices, etc.)

This is usually done with shaders and a circle of buffers which maintain state.

Fragment shaders can only go so far. Can you do in webgpu something like this?

outputTexture2d[inputTexture2d[inputPosition]]++

In other words, if you have a large texture with (x,y) coordinates of points, can you draw another texture that shows a density cloud of these points? In webgl2 it becomes a phd level problem.

Re: WebGPU Fundamentals

#189
post #129

Earlier quoted context omitted.

You oversaw the untrusted part, this is the only reason I prefer web over native really. If there was a way to run native apps with that level of isolation, I would prefer native.

Snap, Flatpack, iOS sandbox, Android sandbox, UWP/Windows sandbox,...

Unfortunately, none of those are cross-platform... Closest we get to something similar to the web is either the JVM or APE (Actually Portable Executable) but then those are generally not as isolated as the alternatives you mentioned, sadly.

Re: WebGPU Fundamentals

#190
post #147

Earlier quoted context omitted.

Apple and Mozilla were the first to have prototypes (one "inspired" by Metal, the other by Vulkan), both looked quite different from the final WebGPU spec though.

This isn’t correct. All 3 parties had prototypes. Mozilla’s first prototype was based on Metal and implemented in Servo. Then we (Mozilla) proposed a Vulkan-like API and had another WIP in Servo, but it was also thrown out.

Thanks for the correction, kvark!
Post reply on HN