Live data from Hacker News

Carbon Language: An experimental successor to C++

github.com

281–290 of 521 posts

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

#281
post #233

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.

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

(-1, -2, -3), is it not?

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

#283
post #249

Earlier quoted context omitted.

The C way makes it hard to find the name of the function (or even tell that it's a function declaration) when the return type is long. std::vector >> foo(std::vector > x, std::unordered_map y);

I said C++ was diff, but how about: using namespace std; typedef vector > foo_bar_xref; foo_bar_xref foo( vector > x, unordered_map y); not sprinkling std:: everywhere helps with readability, but so does defining a couple types used frequently, especially if they are particularly verbose. And of course the parser doesn't really have a problem with this, so your editor should be able to find it with its 'goto declarat…

> not sprinkling std:: everywhere helps with readability

I agree, but most C++ programmers don't :/

> And of course the parser doesn't really have a problem with this, so your editor should be able to find it with its 'goto declaration' function.

C++ syntax is Turing-complete, so due to the halting problem, finding the declaration can take a long time, potentially unlimited in pathological cases.

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

#284
post #226

Earlier quoted context omitted.

> 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…

"... around age 10." C++ (not to mention C)? IIRC, I remember seeing B.S.'s "C with Classes" appear in ACM SIGPLAN Notices in the early 1980s -- 40 years ago. I don't think it hit its peak 10 or even 15 years after its early development. Given that it's C++, that's a pretty major exception.

C++ was huge in the 1990s, C++'s share is probably smaller today than back then since so much of programming has moved over to managed and scripting languages.

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

#286
post #133

Am I the only one that doesn't like this direction for the syntax? This was the main reason why I never got into Rust, it was just too different without any obvious reason. It's strange that I actually enjoy working with type annotated modern Python though. I'll now go away for a few years until the dust settles.

What exactly you don’t like about it?

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

#287
post #233

Earlier quoted context omitted.

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

It depends on how you define addition.

I guess you could make it a vector space through a bijection with the rational numbers, but something tells me C++ programmers don't have that in mind when writing std::vector. And it doesn't solve the problem that C++ “vectors” are resizable.

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

#288

Earlier quoted context omitted.

"I still haven't seen a production level numerical weather prediction app written in Rust. All the time, it is Fortran the government uses for these apps,..." I vacillate as to whether the best response is: "Who cares?" or "give it time"? First, if C++ actually is better for GUI apps, then more power to C++ (do you have some evidence this is the case?). That doesn't mean their aren't other niches to fill for other la…

GP mentioned C++ being replaced by Rust - I'd say that a replacement should be as capable as the thing it replaces, so if that's the claim, then Rust should be at the very least OK for GUI apps. If it's not, then that's also okay, but let's not call it a replacement then. :-) I'm personally excited to see how all those languages will influence each other!

You’re comparing framework for one language to another language.

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

#289
From the README:

> Interoperate with your existing C++ code, from inheritance to templates

Somewhere in the docs (can't remember where) is a link to a Rust/C++ interop project sponsored by Google, Crubit:

https://github.com/google/crubit/blob/main/docs/design.md

In case it's not clear, Carbon is also at the moment a Google project.

There's not much in the Crubit README (although there is a warning not to use it), but the docs directory has some interesting stuff:

> The primary goal of C++/Rust interop tooling is to enable Rust to be used side-by-side with C++ in large existing codebases.

https://github.com/google/crubit/blob/main/docs/design.md

It's not entirely clear whether this interop is to work as envisioned for Carbon (source level?) or some other approach.

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

#290
Carbon Team, thanks for sharing, I will likely use this if I need to bridge with CXX libraries.

Also thanks for adding sum types, and pattern matching, is there anyway you could get the dart team on board? They seem to be averse to them and it's a big reason why I don't use the Dart/Flutter ecosystem.

Post reply on HN