> "Yup, all the things you mentioned are also available in C++, and you've been ignoring and criticizing them for years"<p>Even that's not true.<p>One of the practically valuable things about Rust is that it has a decent and standardised package manager and build tool. C++ does not, and is nowhere close to having that.<p>Another is that the Rust libraries use iterators as a straightforward, composable, and efficient way to write operations on streams of values. The C++ standard library doesn't have anything like that.<p>Rust has a really powerful macro system. C++ doesn't. It has template metaprogramming, which can do most of what macros can, but it's agony to use. C++ is getting some really powerful compile-time programming facilities, but those aren't in a standard yet.<p>There are a lot of things in Rust that are in C++. There are things in C++ that are not in Rust (some of them even useful!). But there are things in Rust that aren't in C++, and when C++ loyalists say there aren't, they just look stupid.
Rust makes things that are technically possible to do in C++, easy to do.<p>Rust makes things that are painful to do in C++, pleasant to do.<p>Rust takes your template compiler errors, and gives you beautiful type parameter errors with underlines.<p>Rust takes your scary macro and turns it into a sanitary macro.<p>Rust takes your crazy diamond of death and towers of inheritance, and gives you traits, associated types, and composition.<p>Rust takes your runtime variant and insane union and gives you real sum types.<p>Rust takes your ASAN, Valgrind, debug alloc builds, and hopes and prayers, and gives you a compiler that let's you use memory safely.<p>Rust is like C++ without the jagged edges, the specification no one understands, removes the dangerous bits that no one person can keep in their head, and trades the useless abstractions for nice functional abstractions that actually are an improvement over writing C.
I'm a big fan of Rust, and seeing that Carmack writes it gives me warm fuzzy feelings.<p>But this link is mostly content-free, and I don't think it's the type of link that inspires useful discussion. I wish that HN had downvotes on posts, though I suppose it uses several other methods.
What is meant by people look to other languages more often because you can do something in C++?<p>/My rephrasing, but I can't parse Carmack's point
For anyone else looking into Rust, I've been experimenting in it for the past month. Heres my thoughts:<p>It advertises itself as a systems level language for the new age, but to me it feels like a functional language in disguise. The borrow checker enforces an unchained functional style (You may have 1 unique mutable reference or may have many immutable references). This sounds bad if you're used to pointer slinging, but once you get used to the peculiarities I find it forces me to write better quality code.<p>The package management is the most refreshing feature. It's a pain to rewrite my personal libraries in each language I use, but I found that most of the things I needed were already available at higher quality than I would have done. (And using them is a single config line).<p>For a 'low level language' they make it pretty hard to do some 'low level' things. Example's I've found include:<p>* writing a doubley linked-list. Consensus is "don't use linked-lists. The stdlib has better tools<p>* Reading a file into a struct. They make it surprisingly difficult to say "hey, read these 10 bytes, its this struct". Consensus is to use more structured file formats like json or protobufs. There's libraries for reading those things.<p>Error handling is similar in style to Go, but it get rid of a lot of the boilerplate. The '?' operator effectively acts as if err return err.<p>The macro system is really nice. I don't write many macros, but it does mean I can use other people's powerful macros. My favorite are 'include_bytes!', 'lazy_static!' and 'dbg!'. The new procedural macros are pretty wacky, essentially allowing you to parse or rewrite the AST. A powerful example I've seen is static checks; This [0] example writes a compile time check to assert that structs do not contain a member named 'bees'.<p>Overall it's been a fun language to mess around with.<p>[0] - <a href="https://tinkering.xyz/introduction-to-proc-macros/" rel="nofollow">https://tinkering.xyz/introduction-to-proc-macros/</a>
As soon as I saw it was just a quote, I had this gut instinct it would be Carmack speaking. The reason is because when DirectX was really marketing hard, Carmack did some work in OpenGL and stood up for it. It was kind of important to me since it was open.