GitHub - Ace17/dscripten: An example of D to asmjs using emscripten (original) (raw)

An example of D to asmjs using Emscripten

Authors

Purpose

This is a demonstration on how D code can be compiled to Javascript using a combination of existing tools.

Demo

You can try an online demo here: http://code.alaiwan.org/dscripten/full.html

Usage

$ export PATH=/tmp/toolchains/llvm-js/bin:$PATH  

Then, add Emscripten itself, i.e the python 'emcc' tool family. This relies on the JSBackend LLVM toolchain.

$ export PATH=/tmp/toolchains/emscripten:$PATH  
$ which -a llvm-config  
/tmp/toolchains/llvm-js/bin/llvm-config  

If you have more than one llvm-config appearing in this list, you're asking for trouble and the build might not work.

rm -f ~/.emscripten  
EMMAKEN_JUST_CONFIGURE=1 PATH=/tmp/toolchains/llvm-js/bin:$PATH /tmp/toolchains/emscripten/emcc  
$ firefox bin/asmjs/game.html  
$ ./build_native  
$ ./bin/native/game.exe  

License