Live data from Hacker News

Is WebAssembly Memory64 worth using?

spidermonkey.dev

11–20 of 55 posts

Re: Is WebAssembly Memory64 worth using?

#11
post #4

The reason I don't use WebAssembly is that browsers do not support the text format. Often it is just a tiny loop that one wants to optimize. Writing it manually in WAT would be nice. But adding a whole toolchain and a compile step to the stack is not worth it. Shouldn't it be straight forward to compile WAT to WASM? I hope one day browsers will support it.

Chances are that you won't get much out of WASM for such small snippets anyway. Contrary to popular belief, well-written Javascript isn't drastically slower than WASM in most situations.

Re: Is WebAssembly Memory64 worth using?

#13
post #2

ARM already have a special instruction `FJCVTZS` to accelerate JavaScript. If WebAssembly gets popular enough there will probably be hardware acceleration for it. https://community.arm.com/arm-community-blogs/b/architecture... https://stackoverflow.com/questions/50966676/why-do-arm-chip...

JavaScript is in the name, but really it's just a way to convert floats to ints with the kind of rounding that x86 does. The impetus might've been to run JS faster because JS specifies x86 semantics, but it's not like it's some wild "JavaScript acceleration instruction". I don't really get why they put JavaScript in the name to be honest.

Re: Is WebAssembly Memory64 worth using?

#14
post #7

"How do browsers take advantage of this fact? By reserving 4GB of memory for every single WebAssembly module." Does reserve mean it has exclusive access to? Because it can't possibly be that every single wasm module takes 4GB!

It's allocating 4 GB out of the virtual address space, not 4 GB of physical memory.

Re: Is WebAssembly Memory64 worth using?

#15
post #4

The reason I don't use WebAssembly is that browsers do not support the text format. Often it is just a tiny loop that one wants to optimize. Writing it manually in WAT would be nice. But adding a whole toolchain and a compile step to the stack is not worth it. Shouldn't it be straight forward to compile WAT to WASM? I hope one day browsers will support it.

Chances are that you won't get much out of WASM for such small snippets anyway. Contrary to popular belief, well-written Javascript isn't drastically slower than WASM in most situations.

Then why does WASM exist? If someone wants to compile whatever other language to run in the browser, why not just compile it to well-written JavaScript?

Re: Is WebAssembly Memory64 worth using?

#16
post #15

Earlier quoted context omitted.

Chances are that you won't get much out of WASM for such small snippets anyway. Contrary to popular belief, well-written Javascript isn't drastically slower than WASM in most situations.

Then why does WASM exist? If someone wants to compile whatever other language to run in the browser, why not just compile it to well-written JavaScript?

We used to have asm.js for that. For various reasons wasm is a replacement for it. JS doesn't even have proper integer types, it is not a good target language.

Re: Is WebAssembly Memory64 worth using?

#18
post #2

ARM already have a special instruction `FJCVTZS` to accelerate JavaScript. If WebAssembly gets popular enough there will probably be hardware acceleration for it. https://community.arm.com/arm-community-blogs/b/architecture... https://stackoverflow.com/questions/50966676/why-do-arm-chip...

Except FJCVTZS is not exclusively useful to javascript. Its behaviour is that of x86 rounding, which is what the JS spec encodes. So it’s also useful for x86 emulation / compatibility in general.

> If WebAssembly gets popular enough there will probably be hardware acceleration for it.

ARM already tried that back in the days with Jazelle. Plus much of the point of WASM is that you can compile it to machine code during loading.

Re: Is WebAssembly Memory64 worth using?

#19
post #15

Earlier quoted context omitted.

Chances are that you won't get much out of WASM for such small snippets anyway. Contrary to popular belief, well-written Javascript isn't drastically slower than WASM in most situations.

Then why does WASM exist? If someone wants to compile whatever other language to run in the browser, why not just compile it to well-written JavaScript?

Simple: Javascript can focus on being a human-friendly programming language, while WASM can focus on being a compile target. If you've been around in the asm.js times, this conflict was a real concern.

Re: Is WebAssembly Memory64 worth using?

#20
post #3

Love to visit untrusted websites that feel entitled to over 4gb ram without asking.

4 GB VA space. Page tables aren’t that expensive.

Isn't the whole reason they're adding 64 bit addresses to support websites which want to use over 4GiB? What other reason could there be?
Post reply on HN