Re:mrustc: In-progress alternative Rust compiler (to C)
by ris on Sunday February 28, 2021 @05:35PM
(#26297752)
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?
[ Parent
| on HN ]
Re:mrustc: In-progress alternative Rust compiler (to C)
by twic on Sunday February 28, 2021 @05:48PM
(#26297845)
It 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.
Re:mrustc: In-progress alternative Rust compiler (to C)
by viraptor on Sunday February 28, 2021 @05:48PM
(#26297848)
For 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
Re:mrustc: In-progress alternative Rust compiler (to C)
by tylerhou on Sunday February 28, 2021 @08:09PM
(#26298730)
The 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.
Re:mrustc: In-progress alternative Rust compiler (to C)
by MR4D on Sunday February 28, 2021 @06:05PM
(#26297955)
It 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.