Live data from Hacker News

Carbon Language: An experimental successor to C++

github.com

231–240 of 521 posts

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

#231

Earlier quoted context omitted.

Yes, you can have a vector of, say, naturals. I'm pretty sure you can even create a vector field out of vectors of non-reals.

A "vector field" and a "field" are two completely different notions. (And yes, you can build a field from integers.) https://en.wikipedia.org/wiki/Finite_field

My bad. I meant to say "vector space", not "vector field". I understand the difference, but I often make this mistake because the set of a vector space is almost always the set of an algebraic field (i.e. the reals).

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

#232
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.

C++'s current unwillingness to specify a stable ABI (or even state that ABI stability is a goal) but also have the standard libraries avoid breaking the ABI is a worst of both worlds currently. And the refusal to break the ABI adds overhead to things like std::unique_ptr which isn't really great. This paper goes into the details https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p18...

Also, the unfortunate associative containers and std::regex.

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

#233
post #118

Earlier quoted context omitted.

A vector can't change its size or contain things that aren't elements of a field. A std::vector can.

Yes, you can have a vector of, say, naturals. I'm pretty sure you can even create a vector field out of vectors of non-reals.

Really? What is the additive inverse of (1, 2, 3) ∈ ℕ³ ?

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

#234

Earlier quoted context omitted.

Doesn't C++11 precede rust?

I had the same question as you so I checked. C++ 11 standard was released in 2011 of course. Rust development started in 2006 and Mozilla announced it officially in 2010.

It's a bit weird to take the release date for one, and the start of the development for the other. By that measure, the first pre-alpha (!) release of Rust was in 2012; the first stable release in 2015. On the other hand, the first RFC for C++0x was in 2008.

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

#235

This is the 3rd language I know about that google created. I have no idea why they don't use rust with their C++ code base and I don't know why they made this instead of use zig which actually brings something new to the table. Overall I don't see myself using this. 0/3 google

There is an entire document which explains why they can't use rust or zig.

The short version is that for their particular usecase they need really close ties to C++.

"Existing modern languages already provide an excellent developer experience: Go, Swift, Kotlin, Rust, and many more. Developers that can use one of these existing languages should. Unfortunately, the designs of these languages present significant barriers to adoption and migration from C++. These barriers range from changes in the idiomatic design of software to performance overhead."

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

#236
post #130
post #111

Earlier quoted context omitted.

Considering the seemingly endless list of things that deliberately don't break with the c++ legacy, new syntax is almost the only change left. And if you were about to give c++ a syntax reboot, why wouldn't you look at what successful other modern syntaxes are doing? "c++, but in a syntax for people accustomed to rust instead of in a syntax for people accustomed to C" sounds like a perfectly reasonable approach. Your…

The problem with C++ is it keeps getting better. There was a time when Rust was interesting to me but then C++11 came out. Then they kept improving it

C++11 was where C++ lost me, and I went from saying I knew C/C++ to saying I know C.

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

#237
post #226
post #72

Earlier quoted context omitted.

The syntax looks a lot like Rust, though. I'm surprised they made such a break when there explicit goal is to make migration from C++ as easy as possible. Also, Rust (from my biased point of view) is currently on its way to become the standard low-level language, so I'm not too confident that Rust-but-with-OO is enough of a selling point.

> Rust (from my biased point of view) is currently on its way to become the standard low-level language The evidence seems to suggest the opposite. Other than a lot of talk on programming fashion publications that are always more aspirational than representative (such as this site) Rust seems to have reached 0.3% of the market [1], up from 0.1% a couple of years ago [2], and while that is ok growth, programming langu…

> programming languages with few exception tend to reach, approach, or at least point toward their all-time peak market penetration around age 10

Notable exceptions from the links you've provided:

C#, Java, Go, PHP. All appear to have an upward trajectory today.

Javascript has also seen a similar penetration boost when nodejs came on the scene.

With rust looking to get integration both into the Linux kernel and GCC, that points to some pretty positive things for the language's penetration. Particular in the embedded world.

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

#238
Looking at this [0] news from about a month ago, the Chrome team showed that they are trying to bring Rust to the table. However, their wording was:

> The Chrome security team is working to make a cross-platform memory safe language available to Chromium developers. This document describes how to use that language in Chromium. The language, at least for now, is Rust.

Could this mean that the "at least for now" part might hint to the language discussed in this thread? Memory safety seems to be a core goal of Carbon [1]:

> Safer fundamentals, and an incremental path towards a memory-safe subset

This approach could make sense, looking at their large C++ code base in Chrome.

[0]: https://news.ycombinator.com/item?id=31830020 [1]: https://github.com/carbon-language/carbon-lang

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

#239

Earlier quoted context omitted.

(one of the Carbon leads) Success for the Carbon Language requires it to successfully be an independent and community driven project. We may not succeed (this really is an experiment), but we're working hard to engage broadly and early in large part because of this being such an important goal and priority for us. Projects like this have to start somewhere, but can grow and become community endeavors. We are also alr…

while we have you here, may I ask why is it called Carbon? It is because the symbol for atomic carbon is C ? :)

To make it as hard to search for solutions online as it is for "go".

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

#240

Earlier quoted context omitted.

2. I'm not sure I understand you here. A vector is defined by those operations. A set without those operations, even if it has the same elements, is not a set of vectors anymore. I don't understand your remark about sets here. The correspondence is necessary, because those operations on vectors are induced from the operations of the relevant field of scalars. The operation of adding vectors of bank numbers would be i…

A vector is defined as I did above. It's a homogeneous tuple, i.e. the Cartesian product of n sets, where all sets are the same. Vector addition plus scalar multiplication are not part of the set. Usually they're part of the definition of a vector space. E.g. (R^2, +, ⋅). But you can construct a vector space out of a set of non-vectors (such as matrices), or out of operations other than vector addition and scalar mul…

Then you're using a definition of vector, not used in any mathematics course.

> you can construct a vector space out of a set of non-vectors (such as matrices)

A vector is by definition no more and no less than an element of a vector space. Vectors are defined by vector spaces, not the other way around.

If you have a vector space whose elements are matrices, then those matrices are vectors. And they will be written in coefficients in a given base as tuples.

> out of operations other than vector addition and scalar multiplication

You don't "build vectors out of operations like vector addition and scalar multiplication", as in: you don't choose them. You choose the field and dimension, and those operations (vector addition and scalar multiplication) are a consequence.

> you can use vectors for purposes other than constructing vector spaces, also without involving either of those operations

Again, you don't construct vector spaces out of vectors - there are no vectors without vector spaces. And there are no vector spaces without those operations. But yes, you can use vectors from a given vector space in a greater capacity than just as vectors.

An example, which shows the futility of looking at vectors as just tuples: a real number is a vector in the vector space of real numbers over the field of rational numbers.

Post reply on HN