Live data from Hacker News

WebAssembly

developer.mozilla.org

41–50 of 98 posts

Re: WebAssembly

#41

Can someone educate me why GC based languages aren't supported in wasm ?

It's not that they can't be supported, but they generally have a big runtime, so your compiled output would be big. If you're running WASM in the browser then that's a big image that you need to send to the client.

Re: WebAssembly

#42
post #15

Earlier quoted context omitted.

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.

Advertisers would hate that kind of model. They want perfectly targeted and customized ads for each individual viewer. Baking the ads into the content or page itself would be going back about 20 years in their world.

They can bake the ad servers side in the binaries.

Re: WebAssembly

#43

Can someone educate me why GC based languages aren't supported in wasm ?

Wasm itself is at the level of assembly, not the level of JavaScript. If you want to compile a GC'd language to wasm, you have to bring your own garbage collector and compile it to wasm as well. That's not a showstopper from wasm's perspective, and several languages have done just that, but porting a GC to a new compilation target can be a bit of work.

Re: WebAssembly

#44
post #37

My 2c about wasm so far: I've tried go, rust, c/cpp, webassembly. go - big bundle sizes because of gc I am guessing, idk. c/cpp - I haven't touched c/cpp in a really really long time, but probably the other really good fit. rust - I see rust as the successor to what I would've used c/cpp for, but not sure if rust ecosystem is still fully there. Last time, I had some weird issues with wasm-bindgen. AssemblyScript(AS)…

The rust+wasm story is quite nice these days. I've been working on a rust+wasm SPA for a few months and I have yet to run into issues with the tooling (wasm-pack, wasm-bindgen, etc).

Re: WebAssembly

#45
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?

Performance. See the graphs here: https://fitzgeraldnick.com/2018/02/26/speed-without-wizardry...

Look how much spread there is in the JS, and how little there is in the wasm.

Depending on what you're doing, this may or may not matter to you.

Re: WebAssembly

#46
Wasm is exciting because not only is it a clean, elegant instruction set that has learned a lot from the design warts of JVM and .NET, it also has formal verification as a first-class design goal. This makes it interesting for high-trust environments outside the web context as well.

I made a couple of short explainer videos on it:

- design goals and instruction set:https://youtu.be/VOaSaShAYb0

- mechanizing safety proofs for wasm: https://youtu.be/zsPVbmEPTlA

Re: WebAssembly

#47
post #43

Can someone educate me why GC based languages aren't supported in wasm ?

Wasm itself is at the level of assembly, not the level of JavaScript. If you want to compile a GC'd language to wasm, you have to bring your own garbage collector and compile it to wasm as well. That's not a showstopper from wasm's perspective, and several languages have done just that, but porting a GC to a new compilation target can be a bit of work.

be careful of cycle-collection problems.

Re: WebAssembly

#48
post #24

Earlier quoted context omitted.

It's a pretty common blogging method. Google and many other orgs do that too.

Is it? Can you provide some links to examples?

It is!

Beware the lure of MDX/equivalents. If you want to provide structure to your content and maintain it colocated to where you use it (or imported and type checked for where you have that kind of reusability), components in Markdown is an awful experience. Inverting that and writing Markdown within posts is my current solution. It’s not as nice as a plain .md file but it lets me mix writing and structure without compromise

Re: WebAssembly

#49
post #24

Earlier quoted context omitted.

It's a pretty common blogging method. Google and many other orgs do that too.

Is it? Can you provide some links to examples?

Can't list many from the top of my head. I've seen 'edit source' links on a bunch of sites.

Re: WebAssembly

#50
post #43

Can someone educate me why GC based languages aren't supported in wasm ?

Wasm itself is at the level of assembly, not the level of JavaScript. If you want to compile a GC'd language to wasm, you have to bring your own garbage collector and compile it to wasm as well. That's not a showstopper from wasm's perspective, and several languages have done just that, but porting a GC to a new compilation target can be a bit of work.

Is there a js engine implemented in wasm?
Post reply on HN