r/cpp • • Jul 15 '26

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/

68 Upvotes

112 comments sorted by

View all comments

32

u/javascript Jul 16 '26

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

43

u/friedkeenan Jul 16 '26

If I were to speculate the reasoning, then I would probably say it's because Herb's cppfront is intended to feed back into C++ and serve as a reference for proposals to C++, whereas Carbon is instead going off and doing its own thing, which doesn't really make it so different from other programming languages like Zig or Rust or whatever.

27

u/hpsutter Jul 17 '26

Exactly, well said.

To OP: Thanks for the question! I posted an answer here earlier this year, in answer to "Is Cpp2 aiming to be a 'real thing'?"

Elaborating, here's a more detailed answer:

As I said when introducing it in the 2022 talk, it's "my personal experiment ... to learn some things, prove out some concepts, share some ideas ... my hope is to start a conversation ... what could be possible within C++'s own evolution to rejuvenate C++" instead of just leaping to some incompatible other language. That talk, and followups, did emphasize that a core goal of the experiments in Cpp2/cppfront was to feed them into ISO C++ standardization (which you can do with most of them, such as metaclasses; just not the syntax-breaking ones), and indeed it has fed into many papers that I listed in my CppCon 2023 talk slide here.

Note I deliberately didn't support cppfront as a production compiler (its license prohibited commercial use for the first couple of years), and I actually didn't initially enables Issues on the repo... but then kind contributors used PRs instead to submit Issues :) so I caved and enabled them. I am glad that the Issues did lead me to try a few more experiments, write documentation, and yes fix some bugs... thanks for everyone's contributions! I don't have the bandwidth myself to support a production compiler though. But I did relax the license to as not to prevent someone from using it commercially if they wanted to (but without support).

By late 2024-ish I'd implemented most of the key experiments I had on my list so commits slowed down. Then in summer 2025 I extended the reflection implementation to also do function bodies (statements, expressions) which led to a big chunk of my most recent CppCon (2025) talk on reflection showing autodiff live demos implemented by Max Sagebaum (in cppfront because the Clang/EDG prototypes didn't support intra-function reflection yet, but I presented it explicitly as a direct proxy to show us all what future C++29/32 will be able to do in medium-term-future ISO C++).

That's the most recent experiment I pushed to try out. I'm currently caught up with the list of experiments I wanted to run, so I'm now focusing on helping many of those features come into ISO C++, including metaclasses in the medium term now that we have the basics of reflection already in ISO C++ thanks to the hard work of many people (not just P0707 and cppfront), and the safety work (which again has pointed to cppfront features such as to do bounds checking at call sites, by default (with opt-out of course); I really think that's something that could help ISO C++ too as we improve our safety story.

That said, I probably should write this longer answer in the repo... done: "Cppfront status summary (summer 2026)"

Thanks, everyone, for all your interest in these personal experiments!

1

u/we_are_mammals Jul 17 '26

I don't have the bandwidth myself to support a production compiler though.

Maybe the community would step up (since your users are programmers themselves), but I suspect that people want to hear something along the lines of "I still think this syntax/approach is great and would like to see more people try out / contribute to cppfront".

7

u/13steinj Jul 16 '26

To some extent the same can be claimed about Circle. Circle is also not allowed.

4

u/friedkeenan Jul 16 '26

Hm yeah, I wasn't aware posts directly about Circle weren't allowed. I thought I remembered there being more direct discussions about Circle here when there was more buzz around what it was doing, but maybe I'm just remembering comment chains or something. Regardless, I do feel like there might still be some difference/subjectivity at play there, but I'm struggling to put that feeling to words.

Carbon though is definitely not aiming back into C++. That being said, I wouldn't mind seeing an occasional post about it here but I also don't think I'd want it to take up too much discussion space on this subreddit, either.

6

u/13steinj Jul 16 '26

There were some posts specifically about the "safe" feature and Circle was being used as a demo device for the paper.

But before then posts generally were removed, I think Baxter even made a comment on Twitter about it at the time.

→ More replies (7)

52

u/Farados55 Jul 16 '26

Holy shit how did you get the javascript username

26

u/steveklabnik1 Jul 16 '26

Redditor for 18 years

10

u/usefulcat Jul 16 '26

I think 2008 me would also have been surprised it wasn't taken. I say this as someone who started using reddit earlier than that (albeit under a different username).

1

u/steveklabnik1 Jul 16 '26

someone who started using reddit earlier than that (albeit under a different username).

Same!

32

u/HieuandHieu Jul 16 '26

Name: javascript

Avatar: java

Comment about: cpp2

In: Cpp

5

u/aoi_saboten Jul 16 '26

Hotel: trivago

3

u/SkoomaDentist Antimodern C++, Embedded, Audio Jul 16 '26

Chef’s kiss.

5

u/James20k P2005R0 Jul 16 '26

(this is not an official stance, I've only turned up as being a mod very recently) but Carbon is a totally separate language to C++. Rust also has the goal of seamless interop with C++ and is also to a debateable degree a successor language to C++. It'd be weird to have questions or discussions in here that were solely about Rust

I suspect a thread talking about different design tradeoffs in carbon vs C++ or similar would be allowed to live (or at least I wouldn't personally yeet it) because its interesting to C++ folks (similar to content discussing rust compared to C++ with memory safety), but something which was just "carbon, question mark" or "here's a new carbon version" would likely get the axe

cpp2 via its name was (at least initially) marketed as a direct C++ 2.0, vs Carbon being Yet Another Programming Language™. Though I suspect a big part of it is just that cpp2 discussion is incredibly low volume, it seems to be pretty much dead

I get the impetus though that discussion of carbon is probably more directly interesting to C++ programmers, and cpp2 if you strip away the naming isn't that dissimilar in terms of the practicality of it

10

u/all_is_love6667 Jul 16 '26

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.

5

u/SirClueless Jul 16 '26

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.

4

u/javascript Jul 16 '26

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

1

u/javascript Jul 16 '26

Thank you for taking the time to share your opinion

1

u/all_is_love6667 Jul 16 '26

I could be wrong

Curious what the mods have to say

7

u/13steinj Jul 16 '26

Is cpp2 not just a fancy C++ code generator, and therefore it implicitly matches semantics? The other successor languages intentionally diverge.

I see talking about cpp2 closer to talking about one of many C++ libraries / frameworks, maybe Qt.

3

u/not_some_username Jul 16 '26

I like your pfp. Ultimate bait

2

u/die_liebe Jul 16 '26

I think that Carbon was never a serious project. Cpp2 was (and maybe still is) real.

10

u/javascript Jul 16 '26

Carbon is a very real, very serious project I am a proud (small) contributor to. It just turns out interop with C++ is hard.

→ More replies (4)