4 ms·
"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. Stroustru
by 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.