3 ms·
ok, so the main usage of emscripten is to compile C++ to javascript and then call them from the "normal" frontend javascript code? ie. most UI related frontend
by shanwang 10y ago
ok, so the main usage of emscripten is to compile C++ to javascript and then call them from the "normal" frontend javascript code? ie. most UI related frontend job will still be coded in javascript?
As to the question why, C++ is not only about runtime performance, it's a more mature language than javascript/typescript and there are powerful data structure/design patterns/algorithms that are missing from javascript. Of course I see it this way because I'm way more competent in C++ than javascript.
- andrewmcwatters 10y agoI definitely appreciate that being a C and C++ developer, but you're sorely misled if you think that runtime carries over. Emscripten just translates the language to something usable through asm.js with a similar execution flow, but you end up running JavaScript. That's what it compiles to. Even WebAssembly is designed to run something that is consumed by the very same JavaScript runtime.
- shanwang 10y agoAre you sure about WebAssembly? I thought it's a new byte code standard and a completely new runtime on its own.
- andrewmcwatters 10y agoYeah, it's designed to pass through the same mechanisms that handle JavaScript. It's a new byte code standard afaik, too, but one that's used in those systems.