3 ms·
>Sorry, the C++ grammar is terrible. When did I say otherwise? What I said was that it's not the main cause of C++'s long compilation times. The grammar causes
by fluoridation 3y ago
>Sorry, the C++ grammar is terrible.
When did I say otherwise? What I said was that it's not the main cause of C++'s long compilation times. The grammar causes other problems, such as making it more difficult to write parsers for IDEs, and creating things like the most vexing parse.
>However, you are the first person I think I have ever heard claim that Rust is faster than C++. Rust is notoriously slow to compile.
It's kind of a mixed bag. Given two projects of similar complexity, one in C++ and one in Rust, the one written in Rust will take longer to compile if organized as a single crate, because right now there's no way to parallelize compilation within a single crate. However, compiling the C++ version will definitely be the larger computational task, and would take longer if done in a single thread. Both contain Turing-complete meta-languages, so both can make compiling a fixed length source take an arbitrarily long time. Rust's type system is more complex, but I think C++'s templates win out on computational load. You're running a little dynamically typed script inside the compiler every time you instantiate a template.