If anyone from Cheerp reads this, I use emscripten ( https://github.com/kripken/emscripten ) at the moment, is Cheerp any better ? Specifically does it compile faster, generates a smaller final .js output, or produce "faster" code ?
Cheerp – A C/C++ compiler for web applications
21–30 of 54 posts
Re: Cheerp – A C/C++ compiler for web applications
#22Re: Cheerp – A C/C++ compiler for web applications
#23I wonder what advantages choosing C++ to write web apps would bring. At the end of the day it's all JavaScript so performance is rather moot point.
For example take something like Dropbox's Carousel architecture, which shares the client side cache, date model, and sync client between iOS and Android via a C++ library. Something like Cheerp or Emscripten allows you to also use this same library on the web.
Re: Cheerp – A C/C++ compiler for web applications
#24Re: Cheerp – A C/C++ compiler for web applications
#25I know C and C++ pretty well; I wonder what this "C/C++" language is like.
Re: Cheerp – A C/C++ compiler for web applications
#26I wonder what advantages choosing C++ to write web apps would bring. At the end of the day it's all JavaScript so performance is rather moot point.
> it's all JavaScript so performance is rather moot point If that was the case, http://asmjs.org/ wouldn't be a thing.
[0] https://code.google.com/p/v8/issues/detail?id=2599#c53
[1] http://mrale.ph/blog/2013/03/28/why-asmjs-bothers-me.html
Re: Cheerp – A C/C++ compiler for web applications
#27I wonder what advantages choosing C++ to write web apps would bring. At the end of the day it's all JavaScript so performance is rather moot point.
I wouldn't write a web-only app in C++, but if the same code needs to run on other platforms as well (e.g. native mobile, desktop or gaming consoles) then C/C++ is basically the only choice. Also, at least in emscripten, compiled code is faster then hand-written JS for several reasons (asm.js, LLVM optimizer passes, no gc), so it makes sense to write stuff like physics/pathfinding/AI engines in C/C++ and compile it to JS.
Plus, it's fun to write a desktop OpenGL demo, flip a build system switch and run it in the browser ;)
Re: Cheerp – A C/C++ compiler for web applications
#28I know C and C++ pretty well; I wonder what this "C/C++" language is like.
The subset that is the interception of both? which would be a subset of C. (Although I am pretty sure that wasn't what the author had in mind)
Re: Cheerp – A C/C++ compiler for web applications
#29Earlier quoted context omitted.
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.
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
#30Earlier quoted context omitted.
The subset that is the interception of both? which would be a subset of C. (Although I am pretty sure that wasn't what the author had in mind)
Bjarne has always maintained that C++ is (mostly) backwards compatible with C. And that's what most people mean by C/C++.
They're two different languages. The problem is that different people mean different things by "C/C++". Some people mean "C and C++"; others just seem to be unaware that they're distinct.