2 ms·
C can be done in a single pass, but I think it still requires keeping track of all types, at very least because sizeof() can take an arbitrary expression and es
by pornel 4y ago
C can be done in a single pass, but I think it still requires keeping track of all types, at very least because sizeof() can take an arbitrary expression and essentially query its type.
Rust boldly assumes that the code of the program will fit in RAM, which allows it to have order-independent definitions and not need prototypes.
Rust implementations must do type checking (including type inference), because there's type-based method dispatch.
However, Rust doesn't depend on borrow checking! The mrustc compiler is able to completely ignore lifetimes and still produce correct executables — if the input program was actually valid.