| >Of course it would, that was one of the design goals of C++.
>C90 is mostly a C++98 subset, except for stronger type conversion rules (no implicit void* conversions), precedence order for operator ?: and typedef/struct namespaces. I think either I don't understand something you are trying to say or you are confused. C being a subset of C++ (one of design goals) does not imply C++ is a subset of C. C++ code in general cannot be compiled with C compiler without rewriting. >Yes, but COM is also callable from C by design. Also I have seen many codebases that have restricted C++ code to calling DX APIs, with everything else being compilable by a C compiler as well. You have blah->Foo(bar); in C++. In C it won't compile by any design. That code has to be rewritten as blah->vtbl->Foo(blah,bar). It is not C code as you claimed. It won't compile with C compiler. It's C++. >> Could you explain exactly how this works? ...
>1 - Rename .c translation units to .cpp, .cxx, .C I asked how type checking disappears in this process, not how you compile C with C++.... >PGO data generated by the JIT compiler gets updated after each application execution and is used as input for optimization selection just like in an AOT compiler by a multi-stage compiler. How can a JIT compiler obtain the PGO data in the first place? Is it running under profiler all the time? You realize that you've just refuted your claim about performance not being affected, right? |
Should I enumerate all of them to make you happy?
> You have blah->Foo(bar); in C++. In C it won't compile by any design. That code has to be rewritten as blah->vtbl->Foo(blah,bar). It is not C code as you claimed. It won't compile with C compiler. It's C++.
Nothing prevents you to write COM calls in C++ code just like in C, blah->vtbl->Foo(blah,bar). The code won't stop compiling.
> I asked how type checking disappears in this process, not how you compile C with C++....
The whole point was about writing C like code with a C++ compiler.
> How can a JIT compiler obtain the PGO data in the first place? Is it running under profiler all the time? You realize that you've just refuted your claim about performance not being affected, right?
By using a multi-stage JIT compiler with different levels of optimization and making use of multi-cores.
99% of the applications are never able to saturate all cores to the point it matters to the overall performance.
I have always been on the Pascal and C++ side against C since the early 90's on BBS and USENET.
So this type of disbelief against better tooling is not strange to me.
Cry Engine, Unreal (C++ with GC), Unity, MonoGame, with their separation between lower level C++ and higher level languages, and the way those engines are being adopted by Sony, Nintendo, Microsoft, Amazon, Google speak for themselves.
Just like C and Pascal overtook Assembly, C++ overtook C, something else will overtake C++.