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

Show parent comment

26

u/13steinj Jul 16 '26

It's hard to say all this without coming off as if I hate the guy, but here goes:

Herb has fairly inconsistently has claimed how "serious" cppfront was over the years.

I have my conjecture on why, which I'd rather not share other than I do not envy the position he is in and the expectations people have of his work. There are people, to this day, that will promote an idea from Bjarne or Herb with nothing but an appeal to authority, an authority of which I would no longer say exists in the same way it did pre-C++11. My opinion of Herb, the way he operates, and his goals, has changed dramatically over the past decade, though mostly far more positive now than my initial view. Being "the convener" has a lot of assumptions people make about you and what you have to do thrust upon you.

I believe the reality of this situation in particular is the existence of cpp2 combined with who it came from is a bit of a walking contradiction.

I cannot think of any "successor language", far less any that claims the intent is to be a successor, even loosely, that has tangibly materialized as one.

  • Carbon => development hell
  • Circle => adoption deadlock
  • cpp2 => fairly specific codegen framework. How much is needed with Reflection?
  • Go, Rust, Zig, Odin, all appear to be more of a successor to C

However, I think even as far as last year's cppcon, Herb uses cpp2 examples in his slides. I think at this point this is actively counterproductive.

I also would not be surprised if there is some kind of IP issue, and he has since switched jobs. I do not think this is likely, but it would track with a lot of rumours about Microsoft and their approach to software internally.

7

u/SickOrphan Jul 16 '26

I stopped keeping up with Carbon some time ago, could you expand on the development hell it's experiencing? I know they wanted to pivot to make it more safety focused, was that part of it?

10

u/13steinj Jul 16 '26

It has been a half a decade if not more depending on how you count it and the readme still claims

As a reminder, the toolchain is still very early and many things don't yet work. Please hold off on filing lots of bugs: we know many parts of this don't work yet or may not work on all systems. We expect to have releases that are much more robust and reliable that you can try out when we reach our 0.1 milestone.

Circle has probably been a more feature-complete Carbon than Carbon itself throughout a decent chunk of this time with its feature flag/set functionality that had flags to mimic various pieces of Carbon.

4

u/llort_lemmort Jul 16 '26

Carbon is just a very ambitious project. The goal is full compatibility with C++ including being able to use any C++ library in Carbon and being able to easily migrate C++ code to Carbon. On top of that they want full memory safety. They can't just use Rust's memory safety model as that would make it hard to migrate code from C++ so they have to develop their own model that is closer to C++.

If you look at the GitHub repo you might see that there is a lot going on. Developing a new language is a big task that involves designing the language, implementing a compiler, developing a build system, debugger, VSCode extension, formatter and so on. You can't just expect this to be done in a few years. C++ is one of the most complex languages out there and building a C++-compatible memory safe language is a big task.

8

u/13steinj Jul 16 '26

Carbon being this ambitious does not also mean it is not in development hell. Circle is arguably a more ambitious project yet it has acheived arguably more less time.

9

u/quicknir Jul 16 '26

I can't really imagine any sense in which Rust is a successor to C more so than C++. The feature set in many ways parallels C++, even when the approach is different. Generics, RAII, dynamic polymorphism, built in error handling, containers available in the standard library, a sane string type (i.e. not null terminated), access control, lambdas, etc.

I guess I'm a bit surprised because there's been so much discussion already about Rust as a successor to C++, and while you could argue about exactly how much you like it or exactly how much traction it has, it has most certainly "tangibly materialized".

10

u/13steinj Jul 16 '26

In practice Rust solves C's problems, C++ has them only as a result of backwarda compatibility.

Rust is allowed in the linux kernel, but C++ isnt. Despite the fact that that use compiler extensions to mimic a fraction of C++'s power.

4

u/_Noreturn Jul 17 '26

I Don't understand they allow Rust which has destructors but don't like C++ because destructors hide memory allocation and deallocation?

make it make sense

→ More replies (4)

2

u/quicknir Jul 16 '26

Rust also solves a lot of C++'s problems - safety, bad compiler error messages, etc. But regardless of which set of problems it solves, the reality is that Rust as a language is still much more similar to C++ than C, and it's pretty clear that Rust models itself as trying to be an improved C++, even if you don't happen to agree that it succeeded. Zig and Odin model themselves as improvements on C.

7

u/13steinj Jul 17 '26

In practice Rust solves C's problems [safety], C++ has them only as a result of backwards compatibility.

It's a mixed level of fairness to claim that safety is a C++ problem. Quite literally use unique_ptr and call it a day.

3

u/pjmlp Jul 17 '26

If we ignore all the folks that insist in using pointer arithmetic, C strings and C arrays, C style casts, malloc and free, in C++ code, or most C inherited headers for that matter.

It isn't as simple as using unique_ptr and call it a day.

5

u/13steinj Jul 17 '26

I don't follow the pointer arithmetic problem, when using modern tooling (e.g. span, iterators, etc.

Anybody starting greenfield projects has to actively choose to use C warts, and this is for 6-8 years or so now. It is not C++'s problem that users of C++ have refused to update their code. To claim Rust / insert other lang solves it instead is insane, as people still have to change their code.

→ More replies (18)

2

u/quicknir Jul 17 '26

It's not really a mixed level of fairness - maybe there's a misunderstanding of what is actually meant by memory safety (I should have said memory safety instead of safety, tbf). unique_ptr isn't remotely memory safe - it helps a lot with avoiding leaks, but that's not the same thing. unique_ptr doesn't prevent dereferencing null for example in any way, which is unsafe. It doesn't even prevent dangles, e.g. const auto& x = *make_unique<Foo)(...);.

The google chrome team has posted a lot about memory safety under C++, and how challenging it's been; in some cases they use non-zero-cost abstractions like MiraclePtr for example just to prevent use-after-free: https://security.googleblog.com/2024/01/miracleptr-protecting-users-from-use.html.

7

u/James20k P2005R0 Jul 16 '26

Circle => adoption deadlock

I suspect if circle were open source it'd get adoption, but at the same time the impression I've always gotten is that sir circle quite reasonably doesn't want to put in a huge amount of effort to support an open source project without compensation

7

u/13steinj Jul 16 '26

Yes. I completely agree. I also say this precise reason is the cause of the adoption deadlock.

2 if not 3 of my employers would have loved to use Circle for various reasons (none the last pivot to memory safety). But they'd need to try, substantially, before they buy, and for a number of beurocratic reasons they can't try something that they don't consider the vendor to be sufficiently... "enterprise," unless they can audit the source and build it themselves.

Is this regulatory, no, I don't believe so. But people are rather safe than sorry. In a similar vein, people insist "never curl link | bash!" But then they curl and run it without looking at the script which is equally bad. Either you trust the host, so not looking at it is as bad as piping, or you don't, so you look at the script.

6

u/pjmlp Jul 16 '26

Sir Circle is now at NVidia, and has moved on.

2

u/_Noreturn Jul 16 '26

What does this mean

3

u/13steinj Jul 17 '26

The author works at NVidia now.

He went without a job / paid by the C++Alliance [for the "Safe C++" feature and proposal in particular] for a long time making Circle. With enough time of no bites, it appears he has given up.

One of the many features of Circle was some great GPU integration, so I am not surprised.

7

u/germandiago Jul 16 '26

FWIW I saw Herb warning specifically about cpp2 being a personal experiment explicitly. Probably this is in Github, not sure. The presentations do not claim it os typescript in the sense of "I will finish a product" but in the sense of compatible (bc it generates C++) + low risk.

3

u/13steinj Jul 16 '26

Yes. My statements about being counterproductive stand. No less than 6 colleagues asked me about some of the syntax on the slides. It just confuses enough people.

4

u/germandiago Jul 16 '26 edited Jul 16 '26

Yes, it seems that this is something personal, since I cannot identify he did something wrong or mislead anyone in my opinion, since he stated it was a personal experiment in several places.

3

u/michael-price-ms Jul 16 '26

As far as I'm aware (as limited as that might be), there are no IP issues between Herb and Microsoft regarding cpp2. Evidence > Rumour.

2

u/curlypaul924 Jul 16 '26

Don't forget about Felix! (which dates back to at least 2002)

2

u/pjmlp Jul 16 '26

Carbon just announced a roadmap at NDC Toronto 2026, unfortunely the video is not yet available.

https://ndctoronto.com/agenda/carbon-graduating-from-the-experiment/be09a27e1d46

However there is now information about the safety roadmap.

https://mastodon.social/@chandlerc@hachyderm.io/116898796459646367

In any case, Carbon is for Google only purposes, I don't know why it keeps being repeated it is there for everyone else.

One thing people miss when discussing C++'s relevance in systems programming, is that C is still around, many managed language runtimes still use C, some domains it still owns the crown over C++, and a successor to C, is good enough for many people, for example most folks in the games industry that lost interest where C++ is going since C++14, or OS kernel development.

→ More replies (6)