Re:Carbon Language: An experimental successor to C++
by KerrAvon on Tuesday July 19, 2022 @01:47PM
(#32155355)
This is true, although there is this:
Re:Carbon Language: An experimental successor to C++
by zozbot234 on Tuesday July 19, 2022 @11:52AM
(#32153448)
> Also D objects have a different lifetimes & requirements, which complicates things
Does Carbon actually solve these issues, though? It would be great if it did, but they don't list complete interop w/ C++ as an actual goal of theirs, only enough to make it practically viable for development.
Re:Carbon Language: An experimental successor to C++
by kllrnohj on Tuesday July 19, 2022 @11:57AM
(#32153545)
Carbon's memory model is compatible with C++'s[1], so where would you foresee complications? D could have been so much better here if it just hadn't chosen to be a GC'd language. That single choice pretty much kills any easy interop.
1: "For example, C++ and Carbon will use the same memory model." https://github.com/carbon-language/carbon-lang/tree/trunk/do...
Re:Carbon Language: An experimental successor to C++
by zozbot234 on Tuesday July 19, 2022 @11:59AM
(#32153586)
AIUI, you don't need to use D with a garbage collector. It can be disabled.
Re:Carbon Language: An experimental successor to C++
by dymk on Tuesday July 19, 2022 @12:20PM
(#32153963)
The D standard library is heavily tied to the GC. If you want to avoid the GC, you'd have to give up the standard library, and if you do that, you have to give up most of the D ecosystem.
As far as I can tell, there hasn't been progress in untying the stdlib from the GC - https://github.com/dlang/projects/issues/56
Also D objects have a different lifetimes & requirements, which complicates things ( see https://dlang.org/spec/cpp_interface.html#lifetime-managemen... )
Carbon appears to be auto-generating bi-directional bindings, and since it has the same memory model has no such awkward interactions between non-GC'd and GC'd worlds like D does.