Neat project either way.
Cheerp – A C/C++ compiler for web applications
31–40 of 54 posts
Re: Cheerp – A C/C++ compiler for web applications
#32If 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 ?
Dynamic memory management. C++ objects are translated directly to JS objects, without the proxy of an emulated, flat memory space. Allow your applications to exploit the JavaScript VM garbage collector and co-exist with fair, on-demand memory allocation.
I don't think that's a good thing though, since the reason why emscripten compiled code is fast is because it has a flat memory space and doesn't create expensive JS objects.
Only advantage IMHO is that you don't need to allocate a big chunk of memory ahead of time (although I think emscripten still allows a growable heap as an option, but with a performance penalty).
Re: Cheerp – A C/C++ compiler for web applications
#33Earlier quoted context omitted.
> it's all JavaScript so performance is rather moot point If that was the case, http://asmjs.org/ wouldn't be a thing.
According to the Chrome guys...it isn't a thing [0][1], and I tend to agree. They've kept up, and often exceeded FF, IMO, for real code by making a better JIT compiler. They still haven't implemented asm.js and yet their "naive" approach to asm.js style code is on par. [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
asm.js does little for you if you write "real JS", but this thread is about cross-compiling other languages, which clearly has real world use.
Re: Cheerp – A C/C++ compiler for web applications
#34Re: Cheerp – A C/C++ compiler for web applications
#35Earlier quoted context omitted.
That's actually not true. Emscripten compiles to code that is much faster than hand-written JavaScript. In this case they are not using Emscripten or a similar technique but are compiling to regular old JavaScript, so performance probably is the same, rather this might be for people who just like C++, like what GWT is for Java devs.
You misunderstood. People mostly write with C++ when performance is critical. Why? C++ offers deterministic memory management, Specialize to CPU instruction set and better use of CPU caches etc. Those performance benefits would not translate when you cross compile to something like JavaScript. I get the point about converting the legacy desktop apps to web apps, but how would it handle the architectural differences (…
Re: Cheerp – A C/C++ compiler for web applications
#36Earlier quoted context omitted.
That was going to be my response..
I was replying to the statement: "For example, people also write C++ when correctness is critical". And I say if someone writes C++ in a correctness critical system, he must not know what he is doing. Even if you're using only STL, RAII and following all the good coding practices, there are still so many ways to screw things up, that C++ is among the worst choices in this regard.
Re: Cheerp – A C/C++ compiler for web applications
#37Interesting although if you want massive performance on a web application i'd probably vie for erlang unless you're doing something computationally complex on the backend. It would be nice to be able to write code once and use in multiple places but theres often so much extra work involved in that, that for many applications it makes more sense to just use interfaces etc. Neat project either way.
Re: Cheerp – A C/C++ compiler for web applications
#38If 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 ?
http://mozakai.blogspot.co.uk/2013/11/c-to-javascript-emscri...
Re: Cheerp – A C/C++ compiler for web applications
#39The RPC feature sounds like it could be immensely useful for day-to-day web development. But the C/C++ is a deal-breaker for most web developers. Are there any projects that only do the RPC autogeneration stuff?
Also can frontend/backend code be shared (if there are no dependencies to the browser/unix system)?