3 ms·
> But yeah, C++ has flaws. Stroustrup dixit: "Within C++, there is a much smaller and cleaner language struggling to get out." Rust? > The interesting questi
by catnaroek 13y ago
> But yeah, C++ has flaws.
Stroustrup dixit: "Within C++, there is a much smaller and cleaner language struggling to get out."
Rust?
> The interesting question is, why do people keep using it in spite of its flaws? Certainly a large part of that is inertia, but I don't think that that's the only thing.
Ownership management. Which has been expanded into full lifetime management (including that of borrowed pointers) in... Rust!
Static polymorphism. Which is implemented in a crappy way in C++, but at least is doable:
1. Non-specialized templates: Type constructors.
2. Concepts (sadly only in the heads of programmers): Type classes.
3. Exported typedefs and type traits: Type families.
> See, for example, Rob Pike's complaint about why C++ programmers aren't all moving to Go, which essentially ignores a bunch of reasons why you might use C++ (since Go is not a replacement for them).
Dude must be completely deluded.
- hdevalence 13y agoYeah, Rust is really interesting, and something I'd like to try on a real project. Hopefully I'll be able to do something with it this spring. But it's certainly more appealing as a replacement than, say, Go, which I don't think is really even that interesting as a language (but this is a personal opinion which I'm not willing to argue about on the internet). Rust also would immediately solve some things I find particulary annoying about C++ (lack of sum types, inability to create new types that behave identically to old types, etc). One thing that I think would be nice to have in a hypothetical language is vector support for integral types, the same way OpenCL has. The Eigen library for C++ is IMO a really good example of the "Edward C++hands" phenomenon. It's a terrific library, using C++ template magic to produce optimized assembly for your platform, to achieve performance you just can't get with C. On the other hand, it can be annoying to use, since there are places where the C++ warts come out, and the developers have to put in an extraordinary amount of effort just to get there. If you had this kind of thing built into the language, it's much easier for everyone involved: compiler authors, programmers, library developers, etc.
- charlieflowers 13y agoThat's cool. Do any of the new wave of systems programming languages offer this kind of capability? D, Rust, Nimrod, etc.?