r/cpp 7d ago

cpp2 (cppfront) is over?

I haven't used cpp2 (cppfront) much, but I like the idea of it: consistent syntax, consistency of meta-programming (which is done in C++ too, I believe). Herb Sutter presented cpp2 (cppfront) as an experiment. He did not encourage other people to bet on it, exactly. And there hasn't been much activity since 2022. Is the experiment over?

EDIT: Herb's answer is buried deep in the comment section: https://www.reddit.com/r/cpp/comments/1uxkglj/comment/oy06cxw/

64 Upvotes

112 comments sorted by

View all comments

32

u/javascript 7d ago

It confuses me why the mods allow discussion of Cpp2 and disallow discussion of Carbon

10

u/all_is_love6667 7d ago

I am not sure, but I don't think carbon is backward compatible with C++, or respects the C++ ISO standard or existing C++ compiler workflows.

It says carbon has "bi-directional interoperability", but it could not be ideal, and interoperability is not compatibility. It could create some headaches when using toolchains.

Carbon doesn't compile to C++, so by that metric, it's not really "compatible" with C++.

One big obstacle with C++ is being able to easily reuse existing libraries etc. Once a language drifts a bit too far away from C++, it's unlikely that it can really be compatible with C++.

Rust can also interop with C++, in some ways.

That's why I would say carbon is not really related to C++, or at least not enough.

4

u/SirClueless 7d ago

Interoperability with C++ is something so daunting that I don’t think it’s really ever been tried (unless you count, say, Circle in this camp).

I think there’s a clear bright line between languages where you can say, “We both can produce and consume libraries with a C ABI so we are interoperable”, and true interoperability with all (or even most) C++ libraries natively like Carbon is aiming for.

I understand why they don’t allow news posts about it in the subreddit, but at the same time it has a clear extra level of topicality in a C++ sub that, say, Rust or Zig do not.

3

u/javascript 7d ago

And to add on top of that, the Carbon frontend is an exercise in using C++ to implement a Data Oriented LLVM toolchain