GC is necessary for the same reasons, to prevent each language from bringing it's own GC and to enable cross-language interop.
JIT is already implied by the very nature of Webassembly being an architecture independent stack machine, so every runtime has to already be a JIT compiler anyway (except interpreters). Exposing JITing to Wasm code is a natural progression and very valuable.
Not that the WASM spec work doesn't have problems (looking in as an outsider), but the existence of these features are not my complaints.
It seems to me like the main value proposition in Web Assembly was to provide a target for languages like C, C++, and Rust.
However, a few years later, there's not much that has been improved in the WASM world. The work being done on the current proposals is monumental and would require the same level of investment that has already been spent on things like the JVM and the .NET runtime, as you point out. To write a specification as well written as WASM for these things is basically impossible.
And they're only doing that in order to support other high level languages to compile to it without having to ship their own runtimes.
But the problem is that given how hard the work is, the benefit of doing this would need to be enormous to justify spending so much work on it... but it's not! JavaScript, for better or worse, has pretty decent performance and a huge amount of code has been written in it. If you try to re-write something in Java or Go, say, to replace JS, even when WASM supports GC and exceptions, I doubt it'll improve anything over JS performance.
Besides, GraalVM already exists which can run nearly any language with very high performance if you're not completely locked on the web platform.
So, all this drama that's going on around WASM for what?
I say, leave it alone, make sure it stays simple and supports high performance stuff written on non-managed languages... and consider the job done.
I will take a small memory/performance/bandwidth hit to not have to program in JavaScript.
We aren't fully there yet but something like .NET Blazor demonstrates the potential. Once we've over the hump I expect an explosion of alternatives.
Exception Handling appears to be in really good shape right now, but I have my doubts about GC. I'm not sure JIT will ever be solved (right now people seem to just compile tons of modules and hope the browser won't crash).
I don't think any of this means that WASM has a bad future, but it'll probably require a lot of careful work as it has up until now.
I don't see how that harms WebAssembly as a lightweight cross-platform target. It may make it more difficult to implement, but AIUI there will always be room for simpler hosts that leave these features out or keep them simplistic. There is no equivalent ecosystem problem to adding these kinds of features to a language, where all your dependencies will start using them, any more than inherently exists for native code that can already just implement those things itself.
A little late for that. I see that my Chrome browser is currently using 2.66GB of RAM (for about 40 tabs, or about 65M per tab). I remember when I first started using Java, my whole computer only had 8M of RAM, and while it has gotten larger, I think it is still considerably lighter weight than a web app, despite also giving much richer APIs and multi-threading. The advantage of web apps isn't that they're lighter weight from a systems resource point of view, but lighter weight from a user's effort in installing and using the app, point of view (now that Applets are gone).
Stacking abstractions, like how computer architecture used to work in the old days.
Not adding GC or not defining how exceptions work could easily lead to a situation where you want to use a couple of third-party libraries, but discover they, combined, use three different garbage-collecting memory allocators and two different ways to handle exceptions, even where function overloading works differently in different libraries.
As an example, look at string implementations in various C programs. Even if they if they boil down to a pair (int, malloced memory), you still might not be able to pass one obtained from a function in one library to a function in another library.
Additonally, in managed, garbage collected runtimes, like .NET, the handling of native resources with explicit lifetimes is a solved problem as well - garbage collection would be handled by the languages own runtimes, no need to move this responsibility to WASM.
This would also avoid the issue of having the .NET GC and the JS GC coexist - this typical too many cooks scenario of 2 separate GCs is a nightmare to manage.
Another daring, pie-in-the-sky thought: Javascript could use this interface as well, becoming just one of the many languages that can target the browser.
- exception handling
- GC
- JIT
Some people want to make WASM something similar to java bytecode or C#'s IL, and it defeats its purpose of being a lightweight, platform agnostic target
The harm was already done, WASM is still compelling (today), but the direction it is taking mean it'll just die..
I know i'm not the only one who think that, so i'm not surprised how painful it is to work on such field, with such team