Javascript to Elm

14: Webassembly

Informações:

Synopsis

  Webassembly Overview Disclaimer: webassembly does not currently support ‘Garbage Collected’(GC) compilations. This means it’s not yet viable for Elm. It will be, however, important to web development ecosystem as a whole, and thus very much worth our time and energy understanding it, and being ready to leverage it as soon as possible. What is webassembly? wasm is a new portable, size- and load-time-efficient format suitable for compilation to the web. Efficient and fast Open and debuggable (pretty print) Part of the open web platform webassembly must currently be loaded and compiled by JavaScript. General Purpose virtual architecture Webassembly is NOT always faster than JavaScript Pace… Inter opt with JavaScript For basic loading, there are three steps: Get the .wasm bytes into a typed array or ArrayBuffer Compile the bytes into a WebAssembly.Module Instantiate the WebAssembly.Module with imports to get the callable exports Linear Memory rather than js objects that will be GC (garbage collecte