News for hackers. Stuff that matters.
Re:Carbon Language: An experimental successor to C++ by nxobject on Thursday July 31, 2025 @12:14PM (#44747122)
If you've seen this before, it's worth looking at the 2025 roadmap – it's long-term work, a full safety story hasn't been quite figured out (TBD end 2025), and 0.1 is TBD end 2026. About the pace of Rust, although without the active forum that Rust had in its early days.

https://docs.carbon-lang.dev/docs/project/roadmap.html

What _is_ interesting is that I get the impression that Carbon is being workshopped with the C++ community, rather than the wider PLT community -- I worry that they won't benefit from the broader perspectives that'll help it avoid well-known warts elsewhere.

Re:Carbon Language: An experimental successor to C++ by ryanobjc on Thursday July 31, 2025 @12:34PM (#44747312)
I think there are parallels with functional languages on the JVM. The parts that are the worst are the parts that were built for maximum interoperability. Not to mention that the JVM forces classes on you at the deepest opcode levels.

Compatibility with C++ is fine, but so far it seems carbon's safety story is entirely a wishlist rather than anything yet. Seems like Carbon might be a more of a place to demonstrate features for C++ committees than a real language?

Personally I have hand it up to here with lousy programmingn languages that make it easy for me to write bugs.

Re:Carbon Language: An experimental successor to C++ by IshKebab on Thursday July 31, 2025 @02:15PM (#44748456)
> being workshopped with the C++ community

Honestly seems like a dubious idea. The C++ community that remains are even more "just get good" than before. They still think UB all over the place is fine.

Re:Carbon Language: An experimental successor to C++ by bla3 on Thursday July 31, 2025 @02:55PM (#44748873)
I think that might be true of the language committee, but there's presumably a huge crowd of people with existing c++ code bases that would like to have a different path forward than just hoping that the committee changes priorities.
Re:Carbon Language: An experimental successor to C++ by pjmlp on Thursday July 31, 2025 @03:22PM (#44749136)
That is what many of us have done moving into managed languages, with native libraries when required to do so.

The remaining people driving where the language goes have other priorities in mind like reflection.

The profiles that were supposed to be so much better than the Safe C++ proposal, none of them made it into C++26, and it remains to be seen if we ever will see a sensible preview implementation for C++29.

Re:Carbon Language: An experimental successor to C++ by tialaramex on Thursday July 31, 2025 @07:06PM (#44751208)
C++ 26 doesn't have the technology, but it wouldn't matter anyway because what's crucial about Rust isn't the technology it's the culture.

If WG21 were handling Rust instead f64 would implement Ord, and people would just write unsafe blocks with no explanation in the implementation of supposedly "safe" functions. Rust's technology doesn't care but their culture does.

Beyond that though, the profiles idea is dead in the water because it doesn't deliver composition. Rust's safety composes. Jim's safe Activity crate, Sarah's safe Animals crate and Dave's safe Networking crate compose to let me work with a safe IPv6-capable juggling donkey even though Jim, Sarah and Save have never met and had no idea I would try that.

A hypothetical C++ 29 type safe Activity module, combined with a thread safe Animals module, and a resource leak safe Networking module doesn't even get you something that will definitely work, let alone deliver any particular safety.

Re:Carbon Language: An experimental successor to C++ by pjmlp on Friday August 01, 2025 @12:27AM (#44753011)
Yeah, that sums it all quite nicely, see contracts proposal as a good example of that.
Re:Carbon Language: An experimental successor to C++ by justcuriousab on Friday August 01, 2025 @03:29AM (#44753945)
> If WG21 were handling Rust instead f64 would implement Ord, and people would just write unsafe blocks with no explanation in the implementation of supposedly "safe" functions. Rust's technology doesn't care but their culture does.

But Rust allows pattern matching on floats.

https://play.rust-lang.org/?version=stable&mode=debug&editio...

Rust Zulip is C++ WG21 confirmed?

Re:Carbon Language: An experimental successor to C++ by tialaramex on Friday August 01, 2025 @03:45AM (#44754046)
I'm sure you think this was somehow succinctly making your point, but I can't see any connection at all, so if you did have an actual point you're going to need to explain it.
Re:Carbon Language: An experimental successor to C++ by justcuriousab on Friday August 01, 2025 @04:26AM (#44754257)
Float matching in Rust is not supported due to correctness concerns, but due to historical accidents and backwards compatibility.

https://github.com/rust-lang/rust/issues/41620#issuecomment-...

https://github.com/rust-lang/rust/pull/84045#issuecomment-82...

Re:Carbon Language: An experimental successor to C++ by tialaramex on Friday August 01, 2025 @12:40PM (#44759217)
OK? I don't see how that's connected? It's not controversial that f32 and f64 are partially ordered, the problem in C++ is that the difference between "Partially Ordered" and "Totally Ordered" is semantic not syntactic in their language and all semantic mistakes are just IFNDR so it's a footgun.
Re:Carbon Language: An experimental successor to C++ by GuB-42 on Thursday July 31, 2025 @07:11PM (#44751253)
I'd say the C++ community is torn.

Some part of it want C++ to be Rust, with a focus on compile-time safety. Others take "C++" literally as "C with extra stuff" and value performance over safety.

Companies like Google are likely to be in the former camp, as for what they are doing, security is critical. Unsurprisingly, Carbon is a Google project.

Video game companies on the other hand are likely to be in the latter camp. Most of the times, security is not as critical, especially for offline games, and memory corruption usually don't go further than a game crash. Tight memory management however is critical, and it often involves raw pointers and custom allocation schemes.

Re:Carbon Language: An experimental successor to C++ by JonChesterfield on Thursday July 31, 2025 @07:53PM (#44751551)
I blame the "we won't recompile anything ever" stance from the financial organisations for the breakdown. It means C++ cannot fix mistakes, even when they harm performance, under the general name of "abi stability".

Thus there is an opening for a faster language. And still for a safer one. And for an easier one to use. So all C++ has going for it is inertia. It's moribund unless the committee reconsider their stance on intentionally losing the performance competition.

Re:Carbon Language: An experimental successor to C++ by Buttons840 on Thursday July 31, 2025 @09:32PM (#44752151)
Will Carbon improve the ABI situation? Will Carbon be easier to interface with from other languages?

A major role that C plays today is being the common protocol all languages speak[0]. C++ can't fill this role, and neither can Rust.

There is a huge opportunity for some language to become the next common protocol, the common ABI, that all languages share in common.

(Maybe Rust could do this, but they haven't stabilized their ABI yet, and I don't the details.)

[0]: https://faultlore.com/blah/c-isnt-a-language/

Re:Carbon Language: An experimental successor to C++ by Gibbon1 on Thursday July 31, 2025 @11:58PM (#44752892)
I remember reading that google tried to impress on WG21 and 14 the need to update the ABI and they were utterly opposed. The result is google is no longer interested in C++. Apple I think is also no longer interested in C++. I think also Swift now has a stable ABI.
Re:Carbon Language: An experimental successor to C++ by JonChesterfield on Friday August 01, 2025 @03:15AM (#44753875)
A good write up of that is at https://cor3ntin.github.io/posts/abi/
Re:Carbon Language: An experimental successor to C++ by tialaramex on Friday August 01, 2025 @08:22AM (#44755727)
It's implied if you know, but Corentin's post doesn't actually link Titus's C++ proposal P1863 "ABI: Now or Never" which is what we're most concretely talking about here.

Titus correctly predicts the committee's actual response and highlights its danger, summarised in the title. You can pick now, as Corentin desires. You can pick never, which Corentin despairs at - not unreasonably because it means you're giving up performance. But Titus highlights the third option, the committee can instead dither forever never having the courage to announce an ABI break but also lacking courage to declare absolute stability with the encouragement that brings for legacy systems.

ABI Now is - at least in performance - competing with Rust. An ABI swap can make some C++ have the same performance as the analogous Rust which wasn't possible with the old ABI and that matters for outfits like Google.

ABI Never is a different niche. Guaranteed ABI stability gives C++ certainty. It makes C++ a stronger contender for some applications where today it can't go and nor can Rust because people don't think "Just recompile" is a reasonable choice, whether they are correct or not.

ABI Dither is neither of these things. There is no certainty, just because the committee is dithering today doesn't mean they won't make a decision tomorrow, or next year. But meanwhile you're not competitive with the best in class alternatives

Re:Carbon Language: An experimental successor to C++ by IshKebab on Friday August 01, 2025 @02:34AM (#44753618)
Well it's not really C that fills that role it's the C ABI which any language can use without an ounce of C. Rust can use the C ABI.

It would be nice if there was a somewhat higher level ABI that languages could use though. The C ABI is very low level and tedious.

Re:Carbon Language: An experimental successor to C++ by josh11b on Saturday August 02, 2025 @11:05AM (#44768206)
Carbon is performance-first, so ABI instability is the default. We plan to have opt-in ABI stability, but that story is not well developed yet. Replacing C as the lingua franca is not a goal, at least not yet.
Re:Carbon Language: An experimental successor to C++ by wocram on Thursday July 31, 2025 @03:01PM (#44748942)
Carbon is just trying to bring a rust-like edition to cpp, there's no reason for non cpp users to Carbon.
Re:Carbon Language: An experimental successor to C++ by pjmlp on Thursday July 31, 2025 @03:19PM (#44749111)
Main goal for Carbon is to port existing code first, general purpose second, with Google internal teams as main customer.

If it ever goes beyond that remains to be seen.

The Carbon team is the first to point out that anyone doing green field development should reach out to Rust or any managed language that fits the project scope.

Re:Carbon Language: An experimental successor to C++ by chandlerc1024 on Friday August 01, 2025 @12:52AM (#44753122)
> What _is_ interesting is that I get the impression that Carbon is being workshopped with the C++ community, rather than the wider PLT community -- I worry that they won't benefit from the broader perspectives that'll help it avoid well-known warts elsewhere.

FWIW, we're working hard whenever looking at an aspect of the language to look at other languages beyond C++ and learn any and everything we can from them. Lots of our design proposals cite Swift, Rust, Go, TypeScript, Python, Kotlin, C#, Java, and even Scala.

Re:Carbon Language: An experimental successor to C++ by ch33zer on Friday August 01, 2025 @03:12AM (#44753854)
Chandler I would love to be involved in Carbon development to shape its development to be usable at my company or alternatively to use it in my own projects. What is the best way to stay involved in Carbon development? Just the discord?
Re:Carbon Language: An experimental successor to C++ by chandlerc1024 on Friday August 01, 2025 @06:24PM (#44763125)
Re:Carbon Language: An experimental successor to C++ by steveklabnik on Friday August 01, 2025 @03:00AM (#44753796)
Make sure you're checking out Hylo. I'm not sure that its ideas are right for Carbon, but if you're looking for a credible alternative to Rust's take on safety, I think it's one of the better ones.
Re:Carbon Language: An experimental successor to C++ by chandlerc1024 on Friday August 01, 2025 @06:19PM (#44763085)
We've been watching closely since before the name change. =D Had lots of conversations with several of the folks involved.