News for hackers. Stuff that matters.
Re:Will Carbon Replace C++? by ninkendo on Monday February 27, 2023 @07:12PM (#34963982)
> Carbon will face the same issue as Dlang

I think one thing that Carbon has going for it is that it's bidirectionally compatible with C++, in the same way that Kotlin is with Java (or Swift with ObjC). If you have a massive C++ codebase, you're supposed to be able to just add new Carbon code, without changing any of your existing codebase. This should allow gradual adoption at whatever pace you want, which should help adoption a lot.

Re:Will Carbon Replace C++? by humanrebar on Monday February 27, 2023 @10:41PM (#34965361)
Is it? Can you replace C++23 code with Carbon? Will it work with C++ modules? Will the existing find_package calls in downstream C++ CMake projects work?

I'm waiting for some other shoes to drop here. There's some fine print in this promise that isn't widely grokked yet.

Re:Will Carbon Replace C++? by laurentlb on Tuesday February 28, 2023 @12:54AM (#34966134)
It should have enough compatibility with C++ that Google and others will be able to incrementally migrate their C++ code. So C++ modules should be supported.

Code migration is part of the Carbon language requirements. Carbon is being designed because other existing langages didn't focus on this aspect.

The specific details and edge cases are probably to be determined.

Re:Will Carbon Replace C++? by humanrebar on Tuesday February 28, 2023 @06:14AM (#34968068)
It's fine to have a goal for general purpose compatibility with C++, though that's harder than it sounds. More than likely there will have to be lines drawn in the sand like "no ABI compatibility ever" or "assumes you're using only clang toolchains" which will necessarily limit how generally adoptable the language is.

It's clear that compatibility is a goal but it's clearly not a feature yet, so we should be careful to talk about carbon as if it has that feature, especially given how hard that feature will be to implement and support.

I'm more confident that Google will be able to meaningfully use carbon in its monorepo than I am that it will be a good replacement for C and C++ for any given non-Google project.

Re:Will Carbon Replace C++? by pjmlp on Tuesday February 28, 2023 @12:11PM (#34971819)
Google's is mostly happy with C++17, as per their guidelines.