2 ms·
Well, you are asking about disabling borrow checker here, one of the main selling points of Rust and rustc here so I think that's out of the question. When you
by oxff 4y ago
Well, you are asking about disabling borrow checker here, one of the main selling points of Rust and rustc here so I think that's out of the question.
When you do full comparison of what rustc does, and compare it to what you need to do in C++ project to match it, the compile times aren't actually slow since rustc does more with actual guarantees.
- jstimpfle 4y agoBut that was my point, I don't necessarily want to do more. In general I want results faster, and am not willing to trade build speed for more safety checks unconditionally. Having some additional features and checkers is nice, and can even be a life saver, but having to pay a high cost each time I hit compile is not acceptable.
- PoignardAzur 4y agoTo expand on my other answer, part of the problem is that Rust's compile time complexity is in large part spent on knowing what code to execute, not just whether the code is valid. So the compiler will spend some time inferring the types of different variables and what traits those types implement, which is necessary to know which trait methods get called, etc. Dynamically-typed languages get to skip all this and say "my type is either a number or an object, because everything in the universe is either a number or an object", and methods are selected through dynamic dispatch (usually by storing a ton of function pointers everywhere). Rust can't just do dynamic typing and skip the compile-time logic, though you can get close by using lots of dyn traits.