News for hackers. Stuff that matters.
Re:WASM 3.0 Completed by cjs_ac on Wednesday September 17, 2025 @03:42PM (#45280516)
WASM is an abbreviation for WebAssembly. If it doesn't have DOM access, WebAssembly is as related to the Web as JavaScript is to Java. A language ecosystem with no I/O capability is as much use as a one-legged man at an arse-kicking party.
Re:WASM 3.0 Completed by nostrademons on Wednesday September 17, 2025 @04:09PM (#45280779)
Like C, which offloads IO to the standard library?
Re:WASM 3.0 Completed by cjs_ac on Wednesday September 17, 2025 @04:12PM (#45280809)
It's still there - you can still do I/O in C, even if you have to call a library function. In WebAssembly, there's no mechanism for I/O of any sort.
Re:WASM 3.0 Completed by flohofwoe on Wednesday September 17, 2025 @04:32PM (#45281034)
...in WASM you also call a function to do IO though? That function is just provided by the host environment via the function import table, but conceptually it's the exact same thing as a Linux syscall, a BIOS int-call or calling into a Windows system DLL.
Re:WASM 3.0 Completed by marcosdumay on Wednesday September 17, 2025 @07:38PM (#45282817)
As long as that function doesn't receive any parameter that is like any data actually on the DOM.

So you either create a very concrete JS library that translates specific WASM data into IO actions, or one that serializes and deserialize everything all around but can be standardized.

At this point, none of those options are much more capable than Java applets... Or, in fact, if you put a network call between the WASM and the JS, you won't even add much complexity.

Re:WASM 3.0 Completed by flohofwoe on Thursday September 18, 2025 @02:20AM (#45286146)
> At this point, none of those options are much more capable than Java applets

Java applets allowed to load and call into native DLLs via JNI, so they were definitely much more capable than WASM, but also irresponsibly unsafe.

In your own WASM host implementation you could even implement a dlopen() and dlsym() to load and call into native DLLs, but any WASM host which cares about safety wouldn't allow that (especially web browsers).

Re:WASM 3.0 Completed by nostrademons on Thursday September 18, 2025 @07:00PM (#45296060)
That's not really much different from writing a language runtime for any other OS. If you're writing the Linux or Windows IO routines for say Haskell or Python or Scheme, you're writing them in C, and then you either call into them from the language's FFI or invoke platform ABI calls into the runtime from the compiled code.
Re:WASM 3.0 Completed by 3836293648 on Wednesday September 17, 2025 @04:37PM (#45281102)
But that's not the (original) argument being made. Just as IO belongs in POSIX and not C, DOM access belongs in some other standard, not WASM
Re:WASM 3.0 Completed by cookiengineer on Wednesday September 17, 2025 @04:40PM (#45281131)
There is, it is just called WASI and it specifies syscalls in a different way.

WebASM is an assembly-like dialect, after all.

Re:WASM 3.0 Completed by flohofwoe on Wednesday September 17, 2025 @03:52PM (#45280622)
Well, arguably the worst thing about WASM is the naming.

It's neither directly related to the web, nor is it an assembly syntax.

It's just another a virtual ISA. "Direct DOM access for WASM" makes about as much sense as "direct C++ stdlib access for the x86 instruction set" - none ;)

Re:WASM 3.0 Completed by k9294 on Wednesday September 17, 2025 @04:17PM (#45280872)
Oh wow, that really is terrible naming... I always thought WASM was a specification for compiling code into something that runs natively in web browsers—like a web-specific compilation target.. Today I learned.
Re:WASM 3.0 Completed by munificent on Wednesday September 17, 2025 @04:48PM (#45281244)
It's an instruction set architecture that browsers happen to support executing directly.
Re:WASM 3.0 Completed by cjs_ac on Wednesday September 17, 2025 @04:09PM (#45280781)
If you want to compare the situation to x86, direct DOM access for WebAssembly is more akin to the BIOS than C++ stdlib access. If it can't interact with the outside world, it's just a very special toy that you can only use to play a game that isn't any fun, and a good candidate for those 'What's the next COBOL?' discussions that come up every now and then.
Re:WASM 3.0 Completed by marcosdumay on Wednesday September 17, 2025 @07:30PM (#45282753)
It's basically that joke about Haskell, that nobody uses it because it can't have any effect... but for WASM the developers are insisting on making sure it's real.
Re:WASM 3.0 Completed by titzer on Wednesday September 17, 2025 @04:10PM (#45280796)
In German, often things are named for where they came from, like Berliner or Frankfurter. WebAssembly came from the web, so makes sense :)
Re:WASM 3.0 Completed by afiori on Wednesday September 17, 2025 @05:37PM (#45281686)
Webgl can't access the dom either
Re:WASM 3.0 Completed by hollowturtle on Thursday September 18, 2025 @03:14AM (#45286531)
That's opengl on the web, a graphic api, you can't compare the two
Re:WASM 3.0 Completed by afiori on Thursday September 18, 2025 @03:19AM (#45286566)
I agree, but my point is that a language can be useful even if it does not have access to everything
Re:WASM 3.0 Completed by danhau on Thursday September 18, 2025 @05:11AM (#45287379)
WASM is to webbrowsers what WebGPU is to webbrowsers. Designed with browsers in mind, but not bound to them.