News for hackers. Stuff that matters.
Re:Carbon Language: An experimental successor to C++ by the_duke on Tuesday July 19, 2022 @01:52PM (#32155436)
The README doesn't expand on what is probably the most challenging problem: how do you achieve effortless C++ interop without burdening Carbon with all the odd behaviour and memory safety / UB issues prevalent in C++?

In Rust for example, `unsafe {}` blocks are not just "local unsafety". They can freely operate on all memory, so they are infectious and are essentially a marker for "dangerous code below, be extra careful and audit lots".

But if all code can freely interoperate with C++, how do you improve upon C++, apart from relatively isolated features like a better generics system?

To what extend can a Carbon compiler that is deeply aware of C++ semantics mitigate the pitfalls?

Re:Carbon Language: An experimental successor to C++ by IshKebab on Tuesday July 19, 2022 @05:30PM (#32158248)
C++ has many many issues other than memory safety. For example implicit type conversion, template duck typing, the include system, the very very very complicated name lookup system, a gazillion footguns inherited from C.

You can definitely massively improve upon C++ without touching its actual computation model.

Re:Carbon Language: An experimental successor to C++ by pjmlp on Tuesday July 19, 2022 @06:23PM (#32158774)
Starting by using a sane set of compiler flags to make code safer by default.