4 ms·
"I’m convinced that you could design a language about a tenth of the size of C++ (whichever way you measure size) providing roughly what C++ does." B. Stroustr
by ExpiredLink 13y ago
"I’m convinced that you could design a language about a tenth of the size of C++ (whichever way you measure size) providing roughly what C++ does."
B. Stroustrup
http://www.stroustrup.com/masterminds_chapter_1.pdf http://www.stroustrup.com/masterminds_chapter_1.pdf
- dbaupp 13y agoD and/or Rust?
- ExpiredLink 13y ago"Within C++, there is a much smaller and cleaner language struggling to get out ... And no, that smaller and cleaner language is not Java or C#. " B. Stroustrup D or Rust? D and Rust can hardly be considered small and clean languages. D is syntactically close to C++. Rust has 4 pointer types ( http://static.rust-lang.org/doc/rust.html#pointer-types http://static.rust-lang.org/doc/rust.html#pointer-types ).
- Fistandantilus 13y agoI would say that they're still smaller than C++, which has syntactical and semantic corners that very few people even know about.
- zxcdw 13y agoThe fact that very few people know about them speaks for them being rare and intuitively not as big of a problem in the real world than people make it seem like.
- gnuvince 13y agoD is syntactically close to C++, but not C++; Walter Bright made some very judicious choices to make parsing unambiguous and fast. Rust has 4 pointer types, three of which you will use regulary. This design decision is in perfect accordance with the goals of the language, offering a language with safety and performance in mind. It takes a while to get used to, but I don't think that makes the language any less clean.
- steveklabnik 13y agoNot just that, but C++ has one pointer type. Oh, and if you're building a big app, you will probably use and have to learn about shared_ptr, uniq_ptr... and then you're right back to Rust with more typing and less guarantees. There are good arguments not to use Rust today, but I think the 'it has four pointers' complaint is a cop-out, personally.
- gnuvince 13y agoMost reasons not to use Rust come down to the implementation (stability of the compiler, speed of the executables, limited standard library), I haven't seen anyone come out and say that something about the language itself is a complete dealbreaker.
- SamReidHughes 13y agoC++ has a lot more than 4 pointer types. Rust just moved some of them from the library to the language.
- copx 13y agoI think D has more features than C++ at this point. Also you are expected to heavily rely on the GC (the standard library itself does) which puts D into a whole different league i.e. the Python and Go league. It can never be a replacement for C++ for that reason alone.
- steveklabnik 13y agoYou can and people do turn the GC off in D.
- copx 13y agoI know but you are left with a crippled subset then. D was not designed for it. You can turn off the GC in most GC language implementations I know, that does not make them alternatives to languages designed for no-GC code. Non-GC (i.e. maximal and predictable performance) is first class in C++, it is a red-headed stepchild in D.
- kyllo 13y agoSo would you say that GC is the main reason why D did not become very popular as a C++ replacement? I'm not a C++ guy at all, but from my cursory readings D seems better than C++ in just about every possible way, unless you really DON'T want GC.
- copx 13y ago>So would you say that GC is the main reason why D did not become very popular as a C++ replacement? I think so yes. There are strong anti-GC sentiments among the crowd which still swears by C++ and did not move on to C# etc. long ago e.g. AAA-game developers. D had other problems in the past (standard library conflict, poor implementation quality) and suffers from poor marketing, lack of corporate support, and the lack of a "killer app". I think few people would argue these things aren't important for breaking into the mainstream. However, yes, I think the GC issue is the biggest one by far. D is a complex, feature-loaded language (IIRC it has templates, compile-time function execution etc. really C++11-grade and more). It naturally does not appeal to people who are attracted by Python, Go, or even C#. It should attract C++ programmers but largely fails at that and I think the primary issue is indeed its GC-based nature.