3 ms·
To me the question it raises is - does the rust borrow checker need to be part of the compiler or could it be separated into a standalone component? Is the borr
by ris 6y ago
To me the question it raises is - does the rust borrow checker need to be part of the compiler or could it be separated into a standalone component? Is the borrow checker architecture-agnostic?
- twic 6y agoIt is architecture-agnostic. As currently implemented in rustc, it operates on an intermediate representation that has already had name resolution and some simplification done. As such, i think it would be rather hard to separate from the rest of the compiler.
- viraptor 6y agoFor the first one, definitely could be split. You can already run that part without code generation - https://doc.rust-lang.org/cargo/commands/cargo-check.html https://doc.rust-lang.org/cargo/commands/cargo-check.html
- MR4D 6y agoIt would be a nice addition in use similar to the auto-complete function - when you write a line of code that uses a value the breaks the tiles, it highlights the code right there. That alone would make rust a much easier language for newbies.
- tylerhou 6y agoThe borrow checker is actually fairly simple to implement, if you have the types. To deduce types, you need to parse the grammar, understand the control flow, and resolve any builtins. But you don’t need to emit any further representation.