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.
Cheerp – A C/C++ compiler for web applications
11–20 of 54 posts
Re: Cheerp – A C/C++ compiler for web applications
#12Earlier 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 (…
Performance is a big reason people use C++, but there are many others. For example, people also write C++ when correctness is critical (bank software, safety-critical systems, etc.).
Re: Cheerp – A C/C++ compiler for web applications
#13I 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…
Re: Cheerp – A C/C++ compiler for web applications
#14Earlier 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
#15Earlier quoted context omitted.
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 (…
> People mostly write with C++ when performance is critical. Performance is a big reason people use C++, but there are many others. For example, people also write C++ when correctness is critical (bank software, safety-critical systems, etc.).
Re: Cheerp – A C/C++ compiler for web applications
#16Other than that, it's an interesting proposition and I look forward to trying it out.
Re: Cheerp – A C/C++ compiler for web applications
#17Earlier quoted context omitted.
> People mostly write with C++ when performance is critical. Performance is a big reason people use C++, but there are many others. For example, people also write C++ when correctness is critical (bank software, safety-critical systems, etc.).
Writing for correctness in a language with no memory-safety, weak type system and, till not very long ago, no standardized memory-model, and UB in every other paragraph of the specs? Good joke. If they are really doing this, they have no idea what they are doing. There are plenty of languages better for safety-critical systems than C++; even widely hated, boring Java is much better.
Re: Cheerp – A C/C++ compiler for web applications
#18Earlier quoted context omitted.
Writing for correctness in a language with no memory-safety, weak type system and, till not very long ago, no standardized memory-model, and UB in every other paragraph of the specs? Good joke. If they are really doing this, they have no idea what they are doing. There are plenty of languages better for safety-critical systems than C++; even widely hated, boring Java is much better.
That was going to be my response..
Re: Cheerp – A C/C++ compiler for web applications
#19I 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.
If that was the case, http://asmjs.org/ wouldn't be a thing.
Re: Cheerp – A C/C++ compiler for web applications
#20Earlier quoted context omitted.
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 (…
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.