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) ∈ ℕ³ ?
Carbon Language: An experimental successor to C++
281–290 of 521 posts
Re: Carbon Language: An experimental successor to C++
#282Re: Carbon Language: An experimental successor to C++
#283Earlier 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…
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++
#284Earlier 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.
Re: Carbon Language: An experimental successor to C++
#285Re: Carbon Language: An experimental successor to C++
#286Am 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.
Re: Carbon Language: An experimental successor to C++
#287Earlier quoted context omitted.
Really? What is the additive inverse of (1, 2, 3) ∈ ℕ³ ?
It depends on how you define addition.
Re: Carbon Language: An experimental successor to C++
#288Earlier 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!
Re: Carbon Language: An experimental successor to C++
#289> 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++
#290Also 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.