From b7d0b716fb29d8694303f96e9a48a64c51eb14cc Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Thu, 11 Jun 2015 11:25:55 +0200 Subject: Refactor essential post-MVP features * Format similar to other documents. * Clarify threads. * Move some details of threads on the Web to Web.md. * Move some details of SIMD for the Web to Web.md. * Expand on zero-cost EH. * Move discussion of coroutines to FutureFeatures.md. --- Web.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'Web.md') diff --git a/Web.md b/Web.md index ac24b21..e1f2513 100644 --- a/Web.md +++ b/Web.md @@ -20,20 +20,33 @@ that the design, especially that of the [MVP](MVP.md), are sensible: * A [module](MVP.md#Modules) can be loaded in the same way as an ES6 module (`import` statements, `Reflect` API, `Worker` constructor, etc) and the result is reflected to JS as an ES6 module object. - * Exports are the ES6 module object exports. - * An import first passes the module name to the [module loader pipeline][] and + - Exports are the ES6 module object exports. + - An import first passes the module name to the [module loader pipeline][] and resulting ES6 module (which could be implemented in JS or WebAssembly) is queried for the export name. - * There is no special case for when one WebAssembly module imports another: + - There is no special case for when one WebAssembly module imports another: they have separate [heaps](MVP.md#heap) and pointers cannot be passed between the two. Module imports encapsulate the importer and importee. [Dynamic linking](FutureFeatures.md#dynamic-linking) should be used to share heaps and pointers across modules. - * To synchronously call into JavaScript from C++, the C++ code would declare + - To synchronously call into JavaScript from C++, the C++ code would declare and call an undefined `extern` function and the target JavaScript function would be given the (mangled) name of the `extern` and put inside the imported ES6 module. +* Once [threads are supported](EssentialPostMVPFeatures.md#Threads), a + WebAssembly module would initially be distributed between workers via + `postMessage()`. + - This also has the effect of explicitly sharing code so that engines don't + perform N fetches and compile N copies. + - May later standardize a more direct way to create a thread from WebAssembly. +* Once [SIMD is supported](EssentialPostMVPFeatures.md#Fixed-width-SIMD), a Web + implementation of WebAssembly would: + - Be statically typed analogous to [SIMD.js-in-asm.js][]; + - Reuse specification of operation semantics (with TC39); + - Reuse backend implementation (same IR nodes). [CORS]: http://www.w3.org/TR/cors/ [subresource integrity]: http://www.w3.org/TR/SRI/ [module loader pipeline]: http://whatwg.github.io/loader + [SIMD.js-in-asm.js]: http://discourse.specifiction.org/t/request-for-comments-simd-js-in-asm-js + -- cgit v1.2.3