Mono to Emscripten

Mono has an LLVM compiler. Is there a way to use it with Emscripten (compile C # code for JavaScript)?

+8
mono llvm
source share
3 answers

There is currently no way to do this. It may be possible, but it will take a lot of work. You will need to run mono in full AOT (ahead of time) compilation mode with LLVM codegen. But there are many problems:

  • LLVM is currently not used for all methods, but mono returns to its own code generator in a number of cases. You need to either get LLVM support for all cases, or provide the JS code needed to use LLVM.
  • Mono currently has several architecture-specific files (x86, amd64, arm, etc.) and will probably require an equivalent for JS, both for code generation and AOT runtime.

And so on...

+4
source share

you can try using c # native

see here http://csnative.codeplex.com

0
source share

Even if you run mono in full AOT and compile your program using LLVM, you cannot use it with emscripten. This is a quote from my discussion in the mono group :

Also, no, it is not possible to use emscripten with mono llvm output for many reasons. The output includes calls in mono performance mode and some jumps. Mono uses a custom LLVM with custom IR operations and will not work on emscripten without any work from the end.

0
source share

All Articles