C++ launched its community survey, too

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Feb 28 11:43:11 UTC 2018


On Tuesday, 27 February 2018 at 20:33:18 UTC, Jonathan M Davis 
wrote:
> The other problem is that many of C++'s problems come from 
> being a superset of C, which is also a huge strength, and it 
> would be a pretty huge blow to C++ if it couldn't just #include 
> C code and use it as if it were C++. To truly fix C++ while 
> retaining many of its strengths would require fixing C as well, 
> and that's not happening.

I think you can have C plus another language just fine.

In C++ you use extern "C" as a wrapper, you could easily run a 
completely different parser within an extern "C" block and build 
a different type of AST for it.

This was probably out of reach in the 80s and early 90s when 
compiler resources was an issue, but with LLVM and gigabytes of 
RAM I think it would be quite reasonable to do something like 
that.

People don't do it because the basic counter argument always is 
"but we already support C through linkage", but that doesn't mean 
that there would be no real productivity advantage to building C 
into the language.

Not that I would do it if I designed a system level language, 
mostly because I think it would be better to build tools for 
transpiling code from C to the new language. C is a dead end now, 
I think.

Ola



More information about the Digitalmars-d mailing list