3 ms·
IF I understand correctly, the borrow checker comes with some pretty severe compilation costs, since it requires a pretty wide level of code analysis, and might
by ashtonkem 7y ago
IF I understand correctly, the borrow checker comes with some pretty severe compilation costs, since it requires a pretty wide level of code analysis, and might be single threaded.
- steveklabnik 7y agoNot generally, no. Or rather, there are other things that are a much bigger cost.
- aw1621107 7y agoRust's type system takes up a surprisingly small portion of compilation time. See the comment rooted at [0] for some discussion. tl;dr: Profiling and tests show that codegen and LLVM work takes up the lion's share of compilation time. The borrow checker itself isn't that expensive in the grand scheme of things, and languages like OCaml show that it's very feasible to have a complex type system that compiles quickly. [0]: https://news.ycombinator.com/item?id=22935795 https://news.ycombinator.com/item?id=22935795