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