3 ms·
> But do we really have to compile C# to IL bytecode to CPP source to LLVM IR to asm.js javascript which the browser will compile to native code. I guess you'r
by azakai 13y ago
> But do we really have to compile C# to IL bytecode to CPP source to LLVM IR to asm.js javascript which the browser will compile to native code.
I guess you're saying that it sounds like a convoluted process? There are other ways to run C# on the web, like JSIL which compiles C# more directly to JS. In practice each approach has benefits and disadvantages.
But I wouldn't say that C# to IL to C++ to LLVM to asm.js to native is convoluted. It reuses a lot of existing tools (LLVM, Emscripten), and makes a lot of sense: Once you have C# to C++, you can compile that on any C++ compiler, including platforms where you couldn't run the Mono VM. C++ is as portable as it gets.
- flohofwoe 13y agoActually, it would be interesting what the performance looks like when the intermediate C++ code is fed into compiler toolchains which produce native code, and how this compares to the Mono JIT performance. Also, whether this approach will benefit other Unity target platforms like iOS or Android.