From the blog of Google Developers an very interesting article on how to run C code in a modern browser via Emscripten and WebAssembly
Checkout it on Emscripting a C library to Wasm | Web | Google Developers
Do you know what Emscripting is? just quote the official site
Emscripten is an Open Source LLVM to JavaScript compiler. Using Emscripten you can:
- Compile C and C++ code into JavaScript
- Compile any other code that can be translated into LLVM bitcode into JavaScript.
- Compile the C/C++ runtimes of other languages into JavaScript, and then run code in those other languages in an indirect way (this has been done for Python and Lua)!