Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mono to Emscripten

Tags:

mono

llvm

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

like image 779
Alon Gubkin Avatar asked Aug 10 '11 02:08

Alon Gubkin


1 Answers

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...

like image 155
joncham Avatar answered Nov 15 '22 22:11

joncham