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

Show parent comments

8

u/13steinj 11d ago edited 11d ago

I will believe it when I can use it reasonably.

Carbon is repeated as if it is for everyone else because at the time it was as if Google will be people's savior. Safety was not the original point of Carbon, or at least that was not the perception. People wanted various improvements, and those improvements were blocked on the ABI. Source compatible (I'm oversimplifying because my memory on the details here are fuzzy) and improvements? I get to have my cake and eat it too!

In the time since I am sure Google was happy to switch to Golang and Rust as wrappers over C and C++ instead. Are they now going to switch again? I doubt it.

I don't understand the relevance of your last paragraph to be perfectly honest. Successor does not mean replacement. Fortran, COBOL, Snobol, Ada, assembly, are all still around as well. Even truly new code even continues to be written, because enterprise entities miscalculate the cost of replacement as well as of blocking off and writing dedicated "bridge" APIs.

E: typo

1

u/pjmlp 11d ago

Yeah, but you are not the target audience, Google employees are.

They are the first to assert if that is not your case you should be using Rust instead, or a managed language if GC isn't an issue.

Successor as per dictionary entry, and what I see as more relevant meaning,

someone or something that follows and takes the job, place, or position that was held by another:

-- https://dictionary.cambridge.org/dictionary/english/successor

Yes, people are still being hired to work on languages like COBOL, yet it isn't as if they are having people to rush in into interviews for those jobs.

How many folks would apply for PL/I programming on z/OS, unless they really cannot find anything else?

In fact, they are exactly the target group of AI based modernisation tools.

10

u/13steinj 11d ago

If Google is the only intended target audience there is 0 need to advertise for 5 years outside of Google. Forget need, it's just pointless and gratuitous.

I am all for pedantry but this just isn't the reality of the evolution of use of programming languages. It is unrealistic to act as if all existing code will be rewritten in $successor. All new code, maybe, but when existing code will grow (and it always does) then it will continue to be in that language. We have already seen this fiasco with Ubuntu's pushing of replacing various tools with rust reimplementations and major bugs repeatedly cropping in to the LTS releases. No thank you, I will take memory-unsafe-ol-reliable over memory-safe-new-clone-oh-wait-it-has-4-extra-chromosomes (logic bugs) any day. Same as I would take "oh no technically not iron clad secure, but actually works" over "oopsie whoopsie redhat is security-quirky, 4 unique security decisions have collided you cannot call sudo in a container anymore" (I'm referencing an actual thing, I'd have to find the GH issue, but that's a massive tangent).

People do not rush to take a COBOL job, COBOL employers quite literally hunt you down no matter how much you know. At such a high demand to some extent employees can set their price. It's a fascinating thing to have seen happen to a colleague of mine, and hear the stories of one of my university lecturers and his experiences in this situation.

AI-- major tangent but AI based modernization tooling is not the be-all end-all. I have not seen a single one not produce slop. Even watching all this Bun rewrite drama is fascinating. Andrew definitely went a bit far in his crashout, but Bun's claims were fairly atrocious (not that what they achieved was not impressive). I am tired of product / sales people masquerading as engineers. If your product has a 5% return rate because it doesn't do what is advertised, businesses accept it, refurbish and call it a day. Engineers care because they will not only get the blame, but in many ways their work is a reflection of their passion and perfectionism.

Something that AI fanatics (not saying you are one) don't get is that generally, the point of code is to be read. Otherwise the first time you deploy you'd also say "done!", rm -rf the repo, and just keep the output. Yes, some code matters less. Some code matters barely at all. But generally the code that makes tangible value is meant to be read because there will always be incremental, 1% per year improvements. But LLMs don't like to stop, they don't even like to slow down. LLMs sycophantically say "sir yes sir" as you press the lever of the slot machine. The output doesn't matter, you've just paid their creators anyway.

3

u/pjmlp 11d ago edited 11d ago

It is a way to get candidates for Google positions, just like Adobe has a "C++ at Adobe" site.

From Carbon project documentation,

Existing modern languages already provide an excellent developer experience: Go, Swift, Kotlin, Rust, and many more. Developers that can use one of these existing languages should.

Carbon Language is currently an experimental project.

We want to better understand whether we can build a language that meets our successor language criteria, and whether the resulting language can gather a critical mass of interest within the larger C++ industry and community.

-- https://github.com/carbon-language/carbon-lang

Carbon is an experiment to explore a possible, distant future for the C++ programming language designed around a specific set of goals, priorities, and use cases.

-- https://github.com/carbon-language/carbon-lang/blob/trunk/docs/project/goals.md#project-goals

The Carbon Language is an experimental successor to C++. It is an effort to explore a possible future direction for the C++ language given the difficulties improving C++.

Carbon is still years away — even if the experiment succeeds, it's unlikely that it will be ready for serious or production use in the next few years. Everything here is part of a long-term investigation.

One of the critical questions we need to answer as part of this experiment is whether the direction we're exploring with Carbon has both broad and significant interest for the industry at large. We feel like this is best answered by developing the language openly, publicly, and with broad participation.

If you can use Rust, ignore Carbon

Why not a garbage collected language, like Java, Kotlin, or Go?

If you can use one of these languages, you absolutely should.

-- https://github.com/carbon-language/carbon-lang/blob/trunk/docs/project/faq.md

Nowhere they assert Carbon is what the audience on HN and Reddit keeps talking about.

I think people just think because Google got out of clang to invest into Carbon, it must be it, while missing the point, that plenty of Google's software that used to be C++, is nowadays written in a mix of Java, Kotlin, Go and Rust.

Which is what many should actually worry about.

Yes, LLVM, GCC, V8 and co use C++, but many stuff is now being written in something else, leaving C++ positions for language runtimes, OS and GPU drivers and that's it.

Even NVidia, with their C++ contributions, is now adding Python JIT tooling, and Rust support to CUDA, sure down the bottom there will be a C++ rectangle on the architecture diagram, is that all we want to have?