by samwillis · 4y ago · 0 comments
- Plugins for desktop/mobile apps, wasm provides a nicely sandboxed environment for them.
- Gaming, the combination of WASM and WebGPU will be the perfect platform for cross platform game development. I could see Steam, for example, creating their own runtime.
- Embedded electronics, simplifying the development and deployment of IoT devices.
When it comes to wasm on the server, it’s often talked about as targeting the “edge”. I believe this the next area of massive growth, however the part that I don’t think is fully solved yet is on the database side. If your server app is making multiple database calls from the edge to a central db there is a good chance that it will slower than a traditional (single location) deployment.
What’s needed is a edge first database, we need at least read replicas to be at the edge with your app. Fly.io have something like this with their Postgres’s product. The alternative is to use an eventually consistent db such as CouchBD, but that causes other problems. I’m interested to see if CloudFlare do anything in this area as it’s the part of their stack that’s missing.
That storm already happened. It was called Unity. And since then others have joined, like Unreal.
WASM + WebGPU doesn't bring anything to the table here other than being a decade late, slower, and with fewer features. Why would anything outside of a web app touch any of it? Why would steam bother? You still have to build so, so much platform-specific stuff to make it work (input, audio, windowing, etc...), why would you do all that and then just pay a massive performance overhead to avoid compiling a whopping ~5 times?
WebGPU could potentially see a use as a middleware for things that want to use the GPU but aren't concerned all that much about performance or overhead, things like image filter effects. But there's also no shortage of existing solutions for them, either, like bgfx (as well as domain-specific offerings like halide of course)
Don’t get me wrong, I’m card carrying Unityman and just backed off of XR development recently in favor of more stable webdev work… but WebGL as a solution to high-performance browser gaming was an absolute shitshow from start to finish and I’m not even sure WebGPU lands in time for anything useful to be done with it to deprecate WebGL “support”. I assume that the lightweight 3D solutions based on threejs, etc. are going to drag the rest of the game engine industry kicking and screaming into whatever best solution arises and this wasm-as-k8s sounds like a neat component of that.
Games on the web face far greater issues than WASM or WebGPU can solve (like a complete lack of an asset delivery pipeline), unless you're only after casual flash-style gaming anyway. But mobile largely replaced that market.
3D API for 2010 hardware or last generation raytracing hardware, what do you prefer?
Unity cannot do anything against castrated 3D APIs.
No wonder streaming is where everyone is going instead.
That is absolutely not going to continue being the case.
> No wonder streaming is where everyone is going instead.
"Pixel streaming" is great if you don't have latency requirements or your client has a poor GPU, but otherwise native 3D is superior.
Most devs would obviously still use unreal engine etc, but these engines will be able to give you improved performance of your games by utilizing WASM
except it is, WASM is designed to be AOT compiled to native code.
Sure there is a bit of difference, WASM needs additional bounds checks and WASM also doesn't have all the info a more high level compiler has.
Now Unity is so much more then just a tool to make cross platform easier. So comparing it to WASM is kinda pointless IMHO. Though it probably is a grate choice for any extension mechanism, like mods or even in game scripting.
https://careers.unity.com/position/software-developer-unity-...
Our startup is working on support for Unreal to support WebGPU from 4.24 onwards, and we've already upgraded support so developers can use WebGL 2.0 instead of WebGL 1.0 like was available previously before Epic made it a community supported platform extension.
What all of them have, is being able to take advantage of 2022 hardware in 2022, with 2022 3D APIs.
WASM is like Java bytecode without access to the Java standard library (like, no `java.lang.String` or even `java.lang.Object`... just the primitives).
But it has a mechanism to call "host" or "imported" functions and to use linear memory (an array of bytes which can be shared with other modules and the host), which is how it actually does anything useful.
I can imagine a version of Java that works like this as well, actually, I wonder if there's ever been anything like that?
"Once".
That GC proposal isn't anywhere close to landing. It's making progress, but it's the "Zeno's paradox" kind of progress where the feature seems further away the more they work on it. I wouldn't be surprised at all if it still wasn't supported in browsers in 10 years.
It's less of a problem in 2021 than it was in 1995.
Ironically, those boycotts are now meaningless given Chrome market share, including Electron.
For desktop use, it just never had a good GUI API.
The future of gaming and the metaverse is cross-platform and free of walled gardens, with developers empowered to distribute directly to their end users online without a middleman required. The reinvention and subsequent golden age of high fidelity 3D browser games will be upon us sooner than most realize.
Links for anyone interested:
https://www.theimmersiveweb.com/
Our Discord:
Given that you mentioned Unreal Engine, why the web and not native?
I mean, this sounds like an awful lot of work to port something to the web, when it already runs in every platform.
How will it reduce walled gardens?
Another question : how, as a player, do you run a game like this offline, or run multiplayer when the game company servers have shut down ?
OpenGL/WebGL aren’t well enough aligned with modern hardware to serve as a cross-platform graphics layer.
That’s where the newer APIs come in. Vulkan, Metal and DirectX 12 all follow similar principles that would work from a technical standpoint, but we live in an age where platform vendors would rather cripple their platform than make it easy to port software. Apple is the worst offender here, because while Microsoft isn’t happy about it and disables it in “metro” apps, at least they don’t prevent GPU vendors from shipping Vulkan support for normal “desktop” apps.
But I’m optimistic about WebGPU: It’s designed to be efficiently implemented on top of the vendor APIs, so platform vendors can’t block it. And it’s low-level enough that it should allow implementing modern games on top of it.
(To clarify: I’m optimistic about WebGPU as an API for desktop applications. For browser apps, it seems like all vendors are on board already.)
Their choice of inventing their own shading language instead of using the ONE standard that the industry finally could agree on (SPIRV) makes me very pessimistic.
Apple is purposefully crippling stuff to retain their App dominance yes, but Apple IS a major part of WebGPU. So it never had a chance and was doomed to fail from the very begining.
Google even had a presentation titled "regaining developer trust" on this topic, but WebGPU continued to push WGSL nevertheless.
> Trivially convertable to SPIR-V
> Constructs are defined as normative references to their [SPIR-V] counterparts
> All features in WGSL are directly translatable to [SPIR-V]
> Features and semantics are exactly the ones of [SPIR-V]
> Each item in this spec must provide the mapping to [SPIR-V] for the construct
So WGSL is essentially just an alternative representation for SPIR-V.
But I don't see how this compromises the viability of webgpu.
I fail to see where your point about trust fits in to that.
So you now have a platform target with one codebase that developers can target PC/Mac/Linux, mobile/tablet, and one of the biggest console platforms. I'd say that's pretty powerful.
Apple support for OpenGL is a side effect of NeXT's acquisition, had Copland's efforts succeeded, they would have kept using QuickDraw 3D.
Ah, and Google Maps.
Then there's the huge advantage of encouraging more competition in the CPU market. Something like RISC-V would have a much better chance if you didn't have to recompile everything for it.
I'm surprised native binary is still the standard. Back in the 1990s when I saw Java and then .NET I thought it would be dead by now outside of specialized high performance libraries for things like codecs and cryptography.
> - Gaming, the combination of WASM and WebGPU will be the perfect platform for cross platform game development. I could see Steam, for example, creating their own runtime.
> - Embedded electronics, simplifying the development and deployment of IoT devices.
We will finally be able to write code once and run it everywhere! I bet at least 3 billion devices will run WASM. It's a breakthrough, how come nobody came up with such great idea yet?
Cross-platform Virtual Machines have been around for a very long time, enabling exactly the kind of thing you're talking about. So in-fact, lots of people thought about this, and built various versions of this. The browser doesn't bring anything new to the table here: it's yet another high-level abstraction layer which inevitably will incur performance penalties in a setting where performance means everything. People want to play complex, immersive games at 60 FPS with amazing graphics and textures, sounds, single/multiplayer settings, and more.
The browser was never built for modern triple-A gaming in mind, which means the APIs available for game creators will inevitably be less flexible and lag behind the more platform-native APIs we've had for 30+ years. This isn't a precedent by the way: recently developed APIs such as WebAudio & WebWorkers are just awful and don't come anywhere close to what a desktop application can do on a modern OS, and those are often considered "cutting edge". Synchronization APIs and locking primitives are only now being introduced to browsers - https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_A... - something games could easily make use of outside of the browser for the past 40+ years.
Lightweight gaming can easily take place within the browser, and perhaps this new technology can make that easier to build and use. But to build a proper heavy-weight game - you'll need much more than a browser can offer.
Completely agree that web despite being perfect for light weight and casual gaming, is not (yet) the platform for AAA games.
https://twitter.com/RReverser/status/1471623675623481356
Yes, wasm threading support on the web uses workers + SAB. There are some limitations (the usual issues with blocking on the main thread on the web), but it works well in production for many things.
Sqlite was successfully ported to wasm, maybe something can grow out of that?
SQLite in the browser and at the edge is going to explode in popularity. A slightly unknown feature of SQLite is “sessions” which would allow you to build an eventually consistent system on top of SQLite.
https://www.sqlite.org/sessionintro.html
I can very much see SAAS type apps wheee each costumer/workplace has a SQLite db effectively deployed to the edge.
Something like cockroachdb's serverless might fit too: https://www.cockroachlabs.com/blog/how-we-built-cockroachdb-...
Cloudflare already has a free caching layer, a freemium eventually-consistent KV store that optimises for frequently-read items, and a strongly-consistent datastore. Besides, they partner with other database vendors too: https://blog.cloudflare.com/partnership-announcement-db/
I think you are referring to the upcoming R2 object store? I’m not aware of what I would think of as a “strongly-consistent datastore” which would be closer to a traditional database with querying. It’s that that I think is missing.
Quite right they have partnered with other db providers, however I think there is a need for something native to their platform that ensures good proximity to Workers to ensure low latency.
Lua, JS and LLV IRM?
Lua and JS are not even binary languages.
LLVM-IR has been considered, but has never been suitable as a compiler target. Code is targeted for a specific arch even before it becomes translated into LLVM-IR. Undefined behaviour in C is undefined also in LLVM-IR, and a portable compiler target can not have any. It is also changing too much between compiler versions (which is a reason why SPIR moved away from it).
BTW. It seems that in the long-term, the use of LLVM-IR in compilers is going to be replaced with MLIR (Multi-level IR).
Cloudflare Durable Objects is exactly this.