3 ms·
I'm not convinced this is the correct way to solve the problem of porting C++ to web. AFAIK emscripten can grow heap now and the security implications seem irr
by moonchrome 11y ago
I'm not convinced this is the correct way to solve the problem of porting C++ to web.
AFAIK emscripten can grow heap now and the security implications seem irrelevant to me (you're still inside of a managed memory pool you're not going to do anything that JS code can't do already) - maybe it can allow for more XSS opportunities but I'm not a security expert, seems to me there are much easier ways to do XSS than exploiting bugs in compiled C++ code.
While allocating heap objects trough JS objects might allow VM to reduce fragmentation it's going to put big pressure on the GC (which is a big downside).
With WebAssembly coming up this approach will get even worse in terms of performance
- ploxiln 11y agoI think the point about security is that a C++ program compiled to use a virtual memory array in javascript could be subverted (to do something the programmer and user did not intend) with a buffer overflow etc. the same way a C++ program compiled and running natively could be subverted. With this translation-to-js-objects kind of transpiling, the result is more like java - less arbitrary code execution, more "unhandled exception".