How to use more C/C++ functions?

Emscripten heavily relies on the presence of JavaScript in the host system, I believe, and compilation generates a mixture of Wasm and JS glue & runtime code. That works for the Web and derivatives like Node.js, but is not usable for the IC or other pure Wasm environments.

There currently is no SDK for using C/C++ on the IC, so it would require some work to get LLVM to function, but it can be done. However, if the code to compile makes use of libraries like stdio, then you will be out of luck, because there is no I/O on the IC. You would need a proper emulation layer. Maybe WASI could help there, but I am not aware of anybody who has tried to get this to work.

2 Likes