Changes between Version 1 and Version 2 of Ticket #7058


Ignore:
Timestamp:
10/17/2018 03:24:48 PM (7 months ago)
Author:
mjethani
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7058 – Description

    v1 v2  
    11=== Background === 
    2 We would like to start moving some of our code to WebAssembly if and where possible, as we are running into our limits of what we can do with pure JavaScript (#7000). This is somewhat in parallel to the Emscripten effort, but could also be seen as a way to gradually migrate to that implementation over time. In any case, the lessons learnt from the Emscripten effort would come in handy in this piecemeal migration. 
     2We would like to start moving some of our code to WebAssembly if and where possible as we run into our limits of what we can do with pure JavaScript (#7000). This would be somewhat in parallel to the Emscripten effort, but could also be seen as a way to gradually migrate to that implementation over time. In any case, the lessons learnt from the Emscripten effort would come in handy in this piecemeal migration. 
    33 
    4 The first step for doing is to have a loader that can load a WebAssembly version of a module on platforms that support it and automatically fall back to a pure JavaScript implementation otherwise, based on a mapping somewhere. This could mapping could be in the build script, for example, or it could be hardcoded into the source of the module. 
     4The first step for doing this is to have a loader that can load a WebAssembly version of a module on platforms that support it and automatically fall back to a pure JavaScript implementation otherwise, based on a mapping somewhere. This mapping could be in the build script, for example, or it could be hardcoded into the source of the module. 
    55 
    66These days it's easy to load a WebAssembly module using a few lines of JavaScript: 
     
    1717  loadModule("simple").then(({add}) => 
    1818  { 
    19     console.log(add(0, 2)); 
     19    console.log(add(0, 2)); // prints 3 
    2020  }); 
    2121</script>