Live data from Hacker News

Hello wasm-pack

hacks.mozilla.org

111–120 of 160 posts

Re: Hello wasm-pack

#111

Earlier quoted context omitted.

Currently WASM can't access the DOM. But WASM-native DOM APIs are planned and then you will be able to completely ditch Javascript if you want.

Can you speculate on what these APIs will look like? JS is well suited for dealing with cross-browser incompatibilities because of its reflection support. That is much harder to build in a low-level target like WASM. COM is an example of what we might get, and that is not a pleasant prospect.

plenty of typed languages have reflection. i don’t see how this changes anything?

Re: Hello wasm-pack

#113
post #69

Does anyone have a good sense of the current performance impact of crossing the boundary between JS and WASM? I've often thought it'd be great to be able to expose high-performance data structures (and other infrastructure-level stuff) via WASM and then make use of them from JavaScript, but I seem to recall that the interop performance cost is currently too high to make it worth doing, which leaves WASM mainly only u…

I've read that cryptography algorithms written in wasm (wat format) are nearly as fast as their C implementations.

Re: Hello wasm-pack

#114
post #113
post #69

Does anyone have a good sense of the current performance impact of crossing the boundary between JS and WASM? I've often thought it'd be great to be able to expose high-performance data structures (and other infrastructure-level stuff) via WASM and then make use of them from JavaScript, but I seem to recall that the interop performance cost is currently too high to make it worth doing, which leaves WASM mainly only u…

I've read that cryptography algorithms written in wasm (wat format) are nearly as fast as their C implementations.

is there a format called "wat"?? lol

Re: Hello wasm-pack

#118
post #78
post #69

Does anyone have a good sense of the current performance impact of crossing the boundary between JS and WASM? I've often thought it'd be great to be able to expose high-performance data structures (and other infrastructure-level stuff) via WASM and then make use of them from JavaScript, but I seem to recall that the interop performance cost is currently too high to make it worth doing, which leaves WASM mainly only u…

The cost is more than a JS->JS call, but not drastically so. Every argument must be converted from a number to an int32/float32/float64, which for SMI values is a single branch, for heap numbers a branch and a load. For other JS values, a ValueOf() operation on the JS value. V8 generates little wrappers for these, with inline conversions. It does not currently inline the little wrapper functions, nor use ICs for the…

For v8, doesn’t a try/catch block defeat inlining? It used to, but that was a long time ago.

Re: Hello wasm-pack

#119
post #113

Earlier quoted context omitted.

I've read that cryptography algorithms written in wasm (wat format) are nearly as fast as their C implementations.

is there a format called "wat"?? lol

World of Warcraft's config files are all ".wtf" so there's that, too.

Re: Hello wasm-pack

#120

Can you use JS packages as dependencies?

From the article:

> The next large piece of development work on wasm-pack will focus on using custom segments in compiled WebAssembly to declare dependencies on local Javascript files or other npm packages.

> The preliminary work for this feature has already landed in wasm-bindgen, so the next step will be integrating it into wasm-pack.

Post reply on HN