The latest version of all major browsers support C/C++/etc code compiled to
WebAssembly <http://webassembly.org/> ("wasm") format, in addition to the
older "asm.js" style of compilation targeting a subset of JavaScript
directly.
As far as I know the first library that MediaWiki uses to support
WebAssembly is ogv.js, my codec & playback library which we use for playing
media on Safari, IE, and Edge. ogv.js is packaged with the
TimedMediaHandler extension, and we've used its asm.js mode for about two
years now.
I'd like to enable the WebAssembly mode in production for the faster
compilation times, but want to double-check that we've established some
best practices for WebAssembly usage first.
https://phabricator.wikimedia.org/T181451 -- I've started up a provisional
RFC, currently more of a document with a few pain points called out:
* packaging (check in binaries from a library, or use a package manager
like npm?)
* loading (loading .wasm or .js files as assets, vs what can use RL)
* security (where to concentrate for security reviews, etc)
This may grow into a recommendation on how to package & load things and
some tweaks to RL. If anybody has any questions about the scariness that is
wasm, give a shout. I want to make it not-too-scary. :)
-- brion