Live data from Hacker News

WebAssembly

developer.mozilla.org

11–20 of 98 posts

Re: WebAssembly

#11
post #5
post #4

Earlier quoted context omitted.

How is this any different than getting ads from minified blobs of javascript?

i can usually block those scripts and still have a functioning page

wasm has no effect on that...

Re: WebAssembly

#12
post #3

i am not looking forward to having ads delivered by binary blobs. say farewell to the age of client-side scripting.

I don't think I've ever blocked an ad by way of javascript. My blocking is all done by pattern matching a blacklist of origins.

Re: WebAssembly

#13
post #2

Something that I've been looking for as I try to learn more about WebAssembly is good examples of tasks that, when converted from Javascript to WebAssembly, would be good uses of WebAssembly for performance or memory or other reasons. Does anybody have a link to a blog post or good documentation like that?

>. . .or other reasons.

In my case, that would be anything written in Python that targets WebAssembly.

If Javascript is obviated, that's one less programming language mouth to feed.

Re: WebAssembly

#14
post #2

Something that I've been looking for as I try to learn more about WebAssembly is good examples of tasks that, when converted from Javascript to WebAssembly, would be good uses of WebAssembly for performance or memory or other reasons. Does anybody have a link to a blog post or good documentation like that?

Determinism! [0] I'm switching a browser game side project from Typescript to WebAssembly because determinism enables a simpler style of multiplayer. Instead of relying on a server to manage state, I can just send inputs p2p like a modern fighting game (with rollback [1]). Then the game acts just like singleplayer! For a hobbyist like me, WebAssembly makes the minefield of multiplayer so much easier to navigate. [0]:…

What's nondeterministic about TypeScript / JavaScript?

Re: WebAssembly

#15
post #5

Earlier quoted context omitted.

i can usually block those scripts and still have a functioning page

You can still block those blobs, as they too are loaded by URL.

what i am envisioning here is the content of a webpage compiled with ads therein. it would be desirable by the googles of the world for this very reason.

Re: WebAssembly

#16
post #15

Earlier quoted context omitted.

You can still block those blobs, as they too are loaded by URL.

what i am envisioning here is the content of a webpage compiled with ads therein. it would be desirable by the googles of the world for this very reason.

This can happen as it stands with JS too, though.

Re: WebAssembly

#17
post #15

Earlier quoted context omitted.

You can still block those blobs, as they too are loaded by URL.

what i am envisioning here is the content of a webpage compiled with ads therein. it would be desirable by the googles of the world for this very reason.

This is still possible using JavaScript, and yet it is not widely seen.

You can think of WebAssembly as another mechanism for executing code in the browser in the context of a web page. JavaScript is still required to (1) load the wasm binary, (2) evaluate it and (3) connect it to DOM APIs or really anything outside of the isolated wasm execution context.

Re: WebAssembly

#18
post #15

Earlier quoted context omitted.

You can still block those blobs, as they too are loaded by URL.

what i am envisioning here is the content of a webpage compiled with ads therein. it would be desirable by the googles of the world for this very reason.

Don't worry, won't be likely to happen - the ads that are displayed now as banners are literally bid on when it's loading, so at most the ad serving code would be bundled, but you would still be able to block the binaries they load.

Re: WebAssembly

#19
post #2

Something that I've been looking for as I try to learn more about WebAssembly is good examples of tasks that, when converted from Javascript to WebAssembly, would be good uses of WebAssembly for performance or memory or other reasons. Does anybody have a link to a blog post or good documentation like that?

I’m using WASM as an execution environment for game code. It’s not so much for the performance aspect, it’s more that I can run the same simulations on the client and server side and have them agree. Rather than duplicating the simulation logic, say, in JavaScript and Rust, I can write the simulation logic once in Rust and use it in both places.

Re: WebAssembly

#20
post #14

Earlier quoted context omitted.

Determinism! [0] I'm switching a browser game side project from Typescript to WebAssembly because determinism enables a simpler style of multiplayer. Instead of relying on a server to manage state, I can just send inputs p2p like a modern fighting game (with rollback [1]). Then the game acts just like singleplayer! For a hobbyist like me, WebAssembly makes the minefield of multiplayer so much easier to navigate. [0]:…

What's nondeterministic about TypeScript / JavaScript?

Object enumeration order (before ES2020 [1]), math function accuracy (Firefox and Chrome did standardize on fdlibm though [2]), various timings. All of them can be fixed with caution but it might be easier to use a platform where none of them matters (well, as long as you don't import Math.sin etc. from the environment...).

[1] https://stackoverflow.com/a/30919039/225272

[2] https://www.linux.com/training-tutorials/math-v8-broken-how-...

Post reply on HN