Re:Cheerp – A C/C++ compiler for web applications
by Touche on Tuesday August 12, 2014 @10:53AM
(#8167969)
You do get some of those performance benefits when you cross-compile. JS VMs have different paths for different types of code and the type of code that Emscripten produces goes through a faster path because more is known about the code ahead of time.
[ Parent
| on HN ]
Re:Cheerp – A C/C++ compiler for web applications
by illumen on Tuesday August 12, 2014 @11:42AM
(#8168245)
You also get 1.4MB of code, which takes 1 hour to load on a mobile connection, and reimplements functionality that host JS/Browser provides which goes much quicker ;) Most C++ code does not care about compiled size(especially with templates!!!), but JS code often does, so is written in a smaller way.
Re:Cheerp – A C/C++ compiler for web applications
by flohofwoe on Tuesday August 12, 2014 @12:27PM
(#8168522)
True, you need to be sensible about compiled code size which traditionally wasn't important for C/C++ code, and it's also true that the C++ std lib or careless use oft templates can bloat the code size. On the other hand, three.js which is basically the standard lib for 3D rendering on the web comes at 0.5 MB minified, which isn't exactly small either ;)