
WebAssemply Hello World - wesleytodd
https://github.com/WebAssembly/design/blob/master/JS.md#sample-api-usage
======
auggierose
This paper is great for understanding WASM in depth:

[https://github.com/WebAssembly/spec/blob/master/papers/pldi2...](https://github.com/WebAssembly/spec/blob/master/papers/pldi2017.pdf)

~~~
bassman9000
> The main storage of a WebAssembly program is a large array of bytes referred
> to as a linear memory or simply memory.

> Growing may fail with an out-of-memory condition indicated by grow memory
> returning −1 to be handled by the program.

Back to the basics :)

~~~
brickmort
same as it ever was

------
ygra
How is interop with native JS in WebAssembly performance-wise? If I switch
between WASM and JS every few instructions, will that incur some sort of
context switch? (I recall Firefox having such issues in asm.js where calls
from asm.js into native JS were quite costly.)

~~~
auggierose
WASM has been designed such that these calls can be made in principle very
cheaply. I don't know though how much current engines have been optimised for
that use case though.

~~~
infogulch
How likely is it for all the JS api surface to be exposed to WASM code
directly -- no js required?

~~~
auggierose
I guess pretty unlikely as WASM has been designed to be a generic engine which
is embeddable in other contexts than Javascript as well. You can already
import JS functions into WASM code, I guess the biggest hurdle for JS interop
is that WASM only knows about ints and floats, but not arbitrary JS objects.

------
michaelmior
Can mods fix the typo in the title?

