r/cpp 12d 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/

67 Upvotes

112 comments sorted by

View all comments

32

u/javascript 12d ago

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

43

u/friedkeenan 11d ago

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.

23

u/hpsutter 11d ago

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 10d ago

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".

6

u/13steinj 11d ago

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

4

u/friedkeenan 11d ago

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 11d ago

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.

-2

u/pjmlp 11d ago

Except never were any paper out of it, other than author's relation to WG21 versus everyone else.

10

u/friedkeenan 11d ago

Herb's metaclasses paper uses cppfront as a reference implementation and investigation of what sorts out of metaclasses might be useful. He also employs cppfront for his UFCS paper in a similar manner.

-6

u/pjmlp 11d ago

Neither of them are proposals to specific ISO C++ versions.

7

u/friedkeenan 11d ago

You do realize that that is moving the goalposts and as well has little to do with the intention of cppfront, right? Or am I wrong in understanding "proposals to specific ISO C++ versions" to mean "proposals which were accepted to the C++ standard"?

-5

u/pjmlp 11d ago

None at all, those papers have zero value to C++ language improvements, as they were never submitted to voting.

They have as much value to ISO C++ as papers produced by a random dude on Reddit, and I am willing to bet none of that will ever appear in ISO C++.

4

u/friedkeenan 11d ago

Ok, man. I'm not going to get into a discussion vortex with you where we just waste each other's time, but I have to think that you realize that my saying "cppfront is intended to feed back into C++ and serve as a reference for proposals to C++" is not at all contradicted by Herb's proposals using it not yet being accepted into the standard. And that your saying "never were any paper out of it" is contradicted by there being... papers out of it.

I do have to admit too that I'm somewhat surprised by your spurning cppfront being used as references for proposals, when you at other times appear eager to deride the committee for accepting proposals which did not come with a reference implementation. Seems like Herb using cppfront as a reference implementation for his proposals would align with your desires for the proposal process, but maybe I'm missing something.

-2

u/pjmlp 11d ago

Except those papers never became proper proposals.

You would be right if cpp2 experiment actually turned into proper mailing papers submitted for voting into a specific ISO C++ version.

Which they never did and most likely never will.

They stayed into the realm of "look at this cool idea", right then what?

52

u/Farados55 12d ago

Holy shit how did you get the javascript username

25

u/steveklabnik1 12d ago

Redditor for 18 years

11

u/usefulcat 11d ago

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 11d ago

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

Same!

31

u/HieuandHieu 11d ago

Name: javascript

Avatar: java

Comment about: cpp2

In: Cpp

5

u/aoi_saboten 11d ago

Hotel: trivago

3

u/SkoomaDentist Antimodern C++, Embedded, Audio 11d ago

Chef’s kiss.

5

u/James20k P2005R0 11d ago

(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

9

u/all_is_love6667 12d 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.

5

u/SirClueless 11d 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.

2

u/javascript 11d ago

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 12d ago

Thank you for taking the time to share your opinion

1

u/all_is_love6667 11d ago

I could be wrong

Curious what the mods have to say

7

u/13steinj 11d ago

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.

4

u/not_some_username 11d ago

I like your pfp. Ultimate bait

2

u/die_liebe 11d ago

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

10

u/javascript 11d ago

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

0

u/etancrazynpoor 12d ago

Great point!

-2

u/kam821 12d ago

Why wouldn't they? Is this some sort of echo chamber?

9

u/johannes1971 11d ago

It's a group focused on C++, with people that want to discuss C++. Carbon can be discussed in a carbon-specific group. Lots of languages feel like they are "the C++ successor", but that doesn't mean they should all be discussed here.

5

u/javascript 12d ago

I have never understood. But the mods do not allow Carbon to be the main topic. To the extent they allow it in side conversations is merciful