5 ms·
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++.
by zozbot234 4y ago
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++.
- donkarma 4y agoD is closer to this than this rust rip-off
- zamalek 4y agoLike 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.
- Joker_vD 4y ago> is objectively superior Those objective criteria of superiority being?..
- vazgriz 4y agoIt 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.
- compiler-guy 4y agoThere 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.
- Joker_vD 4y agoIf 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.
- arinlen 4y ago> 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.
- xigoi 4y agoSo by this logic, pretty much every language other than C++ has “objectively best” syntax.
- zamalek 4y agolong long Templates
- Someone 4y agoIf 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?
- nineteen999 4y ago> 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.
- Koshkin 4y agoYeah, why not D? It's such a good, mature alternative to C++, albeit not widely adopted.
- kllrnohj 4y agoD still requires you to write bindings, see https://dlang.org/spec/cpp_interface.html 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-management 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.
- zozbot234 4y ago> 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.
- kllrnohj 4y agoCarbon'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/docs/design#bidirectional-interoperability-with-c-and-c https://github.com/carbon-language/carbon-lang/tree/trunk/do...
- zozbot234 4y agoAIUI, you don't need to use D with a garbage collector. It can be disabled.
- dymk 4y agoThe 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 https://github.com/dlang/projects/issues/56
- pjmlp 4y agoD is always rebooting what they want to be, I no longer think they still stand a chance to be relevant in the next decade.