开发者

Mono to Emscripten

Mono has a LLVM compiler. Is there anyway to use it with Emscrip开发者_高级运维ten (compile C# code to JavaScript)?


There is currently no out of the box way to do this. It might be possible, but it would require a lot of work. You would need to run mono in full AOT (ahead of time) compilation mode with the LLVM codegen. But there are many issues:

  1. LLVM is currently not used for all methods, and mono falls back to it's own code generator in a number of cases. You would either need to get the LLVM suport working for all cases, or provide the JS code needed when LLVM cannot be used.
  2. Mono currently has a number of architecture specific files (x86, amd64, arm, etc) and would probably need equivalent for JS, both for the code generation and for the AOT runtime.

And so on...


you can try to use C# Native

have a look here http://csnative.codeplex.com


Even if you run mono in full AOT and compile your program with LLVM it is not possible to use it with emscripten. This is quote from my discussion in mono group:

Besides that, no, it's not possible to use emscripten with mono's llvm output for a lot of reasons. The output embeds calls to the mono runtime and some trampilines. Mono use a custom LLVM with custom IR operations and that won't work on emscripten without some work on their end.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜