D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17887 - Add WebAssembly reserved version identifier
Summary: Add WebAssembly reserved version identifier
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks: 17886
  Show dependency treegraph
 
Reported: 2017-10-09 09:35 UTC by ZombineDev
Modified: 2017-10-12 20:55 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ZombineDev 2017-10-09 09:35:03 UTC
The first step to WebAssembly support is adding a predefined version, so libraries can adapt (for example the D bindings for SDL2). It is yet to be determined if more parts of the language can be used in addition to the betterC subset, so this may or may not be used in druntime for implementing full run-time support.
Comment 1 ZombineDev 2017-10-09 14:09:13 UTC
DMD PR: https://github.com/dlang/dmd/pull/7202
Comment 2 ZombineDev 2017-10-09 14:44:17 UTC
dlang.org PR: https://github.com/dlang/dlang.org/pull/1905
Comment 3 github-bugzilla 2017-10-12 19:46:19 UTC
Commit pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/8cd923389443cb018feadb1b0b91598cf6b9cc53
Fix issue 17887 - Add AsmJS, Emscripten and WebAssembly version identifiers

WebAssembly (http://webassembly.org/) is a is a low-level binary format
for in-browser client-side scripting (though support for non-browser
execution environments is also planned) and also a JavaScript API. See
https://github.com/WebAssembly/design/blob/master/Portability.md
for more information on the characteristics of this virtual ISA.
All major browser vendors have reached consensus on the WebAssembly API
and binary format, so growth opportunity for D in this area is huge.

The current feature set and toolchain is based on asm.js
(http://asmjs.org/spec/latest/) and Emscripten
(http://kripken.github.io/emscripten-site/).
Emscripten is a toolchain for converting  LLVM IR to JavaScript/asm.js.
Emscripten uses the musl (http://www.musl-libc.org/) libc library,
which potentially requires improving the `version (CRuntime_Musl)`
support in druntime and phobos.

In a couple of years asm.js may be phased-out in favour of WebAssembly,
but for now it is necessary as WebAssembly is not mature enough.