News for hackers. Stuff that matters.
Re:Carbon Language: An experimental successor to C++ by zozbot234 on Tuesday July 19, 2022 @11:07AM (#32152562)
Isn't this one of the most prominent features in D? Sounds like they're trying for something very much like D, while starting closer to current C++.
Re:Carbon Language: An experimental successor to C++ by kllrnohj on Tuesday July 19, 2022 @11:42AM (#32153199)
D still requires you to write bindings, see https://dlang.org/spec/cpp_interface.html

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.

Re:Carbon Language: An experimental successor to C++ by KerrAvon on Tuesday July 19, 2022 @01:47PM (#32155355)
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

Re:Carbon Language: An experimental successor to C++ by int_19h on Monday July 25, 2022 @02:42PM (#32229035)
You don't need non-GC stdlib for C++ interop, though.
Re:Carbon Language: An experimental successor to C++ by pjmlp on Tuesday July 19, 2022 @01:03PM (#32154717)
D is always rebooting what they want to be, I no longer think they still stand a chance to be relevant in the next decade.
Re:Carbon Language: An experimental successor to C++ by donkarma on Tuesday July 19, 2022 @11:31AM (#32152977)
D is closer to this than this rust rip-off
Re:Carbon Language: An experimental successor to C++ by Koshkin on Tuesday July 19, 2022 @01:18PM (#32154927)
Yeah, why not D? It's such a good, mature alternative to C++, albeit not widely adopted.
Re:Carbon Language: An experimental successor to C++ by zamalek on Tuesday July 19, 2022 @11:48AM (#32153332)
Like every braces language following C is a C rip-off?

Rusty syntax is objectively superior to almost everything else we've come up with, there's no reason it shouldn't be copied.

Re:Carbon Language: An experimental successor to C++ by nineteen999 on Tuesday July 19, 2022 @12:23PM (#32154018)
> Rusty syntax is objectively superior to almost everything else we've come up with, there's no reason it shouldn't be copied.

You mispelled "subjectively". Rust is a hideous looking language, despite its many other benefits.

Re:Carbon Language: An experimental successor to C++ by Someone on Tuesday July 19, 2022 @12:10PM (#32153789)
If Rusty syntax is objectively superior to almost everything else we've come up with, that almost should make us think before blindly copying it.

So, for those thinking “Rusty syntax is objectively superior to almost everything else we've come up with” (I don’t, if only because I don’t believe the syntax of programming languages can be compared on quality without considering the audience), what syntax do you believe it not objectively superior to?

Re:Carbon Language: An experimental successor to C++ by Joker_vD on Tuesday July 19, 2022 @12:09PM (#32153779)
> is objectively superior

Those objective criteria of superiority being?..

Re:Carbon Language: An experimental successor to C++ by vazgriz on Tuesday July 19, 2022 @12:29PM (#32154130)
It eliminates the Most Vexing Parse.

Consider this C++ code:

  Foo bar();
A programmer could make simple mistake thinking that is declaring a variable of type Foo. Carbon eliminates this by having explicit keywords for variable and function declaration. (This style is much more Rust based than C++)

  fn bar() -> Foo;
  var bar : Foo;
It makes parsing easier for both the users and maintainers of the language.
Re:Carbon Language: An experimental successor to C++ by compiler-guy on Tuesday July 19, 2022 @12:37PM (#32154252)
There are literally thousands of shipping languages that don't have the most vexing parse problem.

If that is Rust's entire syntax advantage, it isn't a very big one.

Re:Carbon Language: An experimental successor to C++ by arinlen on Tuesday July 19, 2022 @02:22PM (#32155876)
> It eliminates the Most Vexing Parse.

C++'s most vexing parse issue ceased to be a concern around a decade ago with the introduction of uniform initialization.

Re:Carbon Language: An experimental successor to C++ by Joker_vD on Tuesday July 19, 2022 @12:35PM (#32154222)
If that's the only criterion then Pascal's syntax, which doesn't have "the most vexing parse" problem either, and for the same reason, is also almost better than anything else.
Re:Carbon Language: An experimental successor to C++ by xigoi on Tuesday July 19, 2022 @03:05PM (#32156410)
So by this logic, pretty much every language other than C++ has “objectively best” syntax.
Re:Carbon Language: An experimental successor to C++ by zamalek on Tuesday July 19, 2022 @06:43PM (#32158945)
long long

Templates