Live data from Hacker News

Carbon Language: An experimental successor to C++

github.com

21–30 of 521 posts

Re: Carbon Language: An experimental successor to C++

#21
If you are like me and wondering "What makes carbon different from Rust or Zig?

    1. The ability to interoperate with a wide variety of code, such as classes/structs and templates, not just free functions.

    2. A willingness to expose the idioms of C++ into Carbon code, and the other way around, when necessary to maximize performance of the interoperability layer.

    3. The use of wrappers and generic programming, including templates, to minimize or eliminate runtime overhead.
In otherwords, what carbon can do that Rust can't do, is take a C++ class with a `foo` method and call that method. Or create a class with a `foo` method and call that method from C++. Probably one of the biggest hurdles to get over in C++ interopt. Most don't do that, instead you'd make a C function binding and struct and move data/invoke functions through that.

Re: Carbon Language: An experimental successor to C++

#22
post #18
post #7

Earlier quoted context omitted.

It's std::vector that was weirdly named. In plenty of codebases "Vector", particularly gamedev and scientific, will mean the mathematical object with that name. Other languages don't need to replicate this mistake.

True, though in OP's defense I don't know if I've ever seen a language refer to a growing list of entries as an "array".

Well, the data structure is called a dynamic array

Re: Carbon Language: An experimental successor to C++

#23
post #22
post #18

Earlier quoted context omitted.

True, though in OP's defense I don't know if I've ever seen a language refer to a growing list of entries as an "array".

Well, the data structure is called a dynamic array

I don't see any reference to it in the GH readme, but I do wonder what they call actual arrays (as in, fixed size allocations of memory that store a contiguously typed value).

Re: Carbon Language: An experimental successor to C++

#24

If you are like me and wondering "What makes carbon different from Rust or Zig? 1. The ability to interoperate with a wide variety of code, such as classes/structs and templates, not just free functions. 2. A willingness to expose the idioms of C++ into Carbon code, and the other way around, when necessary to maximize performance of the interoperability layer. 3. The use of wrappers and generic programming, including…

Interestingly enough, Chicken Scheme has a library that allows for interop with C++ to this degree:

http://wiki.call-cc.org/eggref/5/bind#c-notes

Re: Carbon Language: An experimental successor to C++

#25
post #18
post #7

Earlier quoted context omitted.

It's std::vector that was weirdly named. In plenty of codebases "Vector", particularly gamedev and scientific, will mean the mathematical object with that name. Other languages don't need to replicate this mistake.

True, though in OP's defense I don't know if I've ever seen a language refer to a growing list of entries as an "array".

Java: ArrayList

Zig: ArrayList

GLib: GArray

Objective-C: NSMutableArray

Re: Carbon Language: An experimental successor to C++

#27
post #9

It's not immediately obvious from this page and GitHub org, but this is a Google led project. It's led by Chandler and the c++ toolchain team. I have no idea of it's endgoals or how open to non-Google ideas it will be.

Sounds a bit like "C++ but we get to change the ABI, and maybe break some old code for the sake of better-enforced safety guidelines".

Re: Carbon Language: An experimental successor to C++

#28
post #23
post #22

Earlier quoted context omitted.

Well, the data structure is called a dynamic array

I don't see any reference to it in the GH readme, but I do wonder what they call actual arrays (as in, fixed size allocations of memory that store a contiguously typed value).

I was talking about std::vector (and Rust's Vec). Those are dynamic arrays (as in, growable allocations of memory that store a contiguously typed value).

Re: Carbon Language: An experimental successor to C++

#29
post #19

It's a shame a stable ABI is declared as one of the non-goals, C++ is painful enough to integrate with other languages.

ABI stability is an unstated goal of c++ and holds it back by preventing meaningful change or fixing of issues. This is good.

Re: Carbon Language: An experimental successor to C++

#30
post #18
post #7

Earlier quoted context omitted.

It's std::vector that was weirdly named. In plenty of codebases "Vector", particularly gamedev and scientific, will mean the mathematical object with that name. Other languages don't need to replicate this mistake.

True, though in OP's defense I don't know if I've ever seen a language refer to a growing list of entries as an "array".

Doesn't seem particularly uncommon. Perl, JavaScript, and Ruby come to mind if you're really looking for languages that use just a raw term "array" with no extra qualifiers.
Post reply on HN