Live data from Hacker News

Cheerp – A C/C++ compiler for web applications

leaningtech.com

1–10 of 54 posts

Re: Cheerp – A C/C++ compiler for web applications

#6
post #2

I 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.

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.

Re: Cheerp – A C/C++ compiler for web applications

#7
post #3
post #2

I 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.

Probably none. However, it could act as a gateway drug for C++ desktop folk. They do exist.

We do exist. The fables are true.

Re: Cheerp – A C/C++ compiler for web applications

#8
From my understanding it also allows you to write your front and back end in one application and language. Then it compiles the front end to JS and the backend to C++ executable. I think this is where a large advantage can be seen. edit: it automates the connection between the front and backends tying the two together.

Re: Cheerp – A C/C++ compiler for web applications

#9
post #2

I 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.

> At the end of the day it's all JavaScript so performance is rather moot point

That's probably true, but C++ does provide very powerful compile-time evaluation mechanisms like templates, constexpr (compile-time evaluated constants and functions), and template metaprogramming. That being said, compile-time C++ can look very gross since most of the features are accidental.

However, there are a lot of huge performance benefits to moving computation to compile time: selecting the most optimal algorithm for a type, guaranteeing you don't mismatch your units, precompiling search (glob, regex) engines, eliminating dead code, and so on.

So I would be shocked if at least some javascript applications couldn't be much faster and more correct by writing in C++ first and compiling to js. That being said, it's probably not in scope for a minimum-viable product, so improving already business-critical parts of the code base might be the best place to start.

Re: Cheerp – A C/C++ compiler for web applications

#10
post #6
post #2

I 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.

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.

While true,if your "c++" hit the DOM , in the client, you'll have the same problems as hand-written JS.
Post reply on HN