3 ms·
They say « It should be noted that this is not an effort to document the entire Rust language and standard library. Ferrocene is the effort to qualify a versio
by mjw1007 4y ago
They say
« It should be noted that this is not an effort to document the entire Rust language and standard library. Ferrocene is the effort to qualify a version of the Rust compiler, which means we can also be selective when it comes to what subset gets documented. »
Not covering the whole library seems natural enough, but I'd be interested in finding out what part of the language they intend to cover.
From the example they give, it looks like they might not be attempting to describe type inference: it repeatedly talks about types as if they're known quantities when considering an expression in isolation.
In fact I wonder whether they plan to cover type checking at all. The "legality rules" section doesn't seem to think it's worth mentioning that a call which doesn't type-check isn't legal.
- UncleEntity 4y ago> In fact I wonder whether they plan to cover type checking at all. The "legality rules" section doesn't seem to think it's worth mentioning that a call which doesn't type-check isn't legal. This might be part of the ‘argument operands’ spec and it is assumed that the function call is passed legal values. I’ve read a few language specs and don’t remember any specifically mentioning the means with which the implementation is required to type check values — could be completely wrong and just don’t remember so take that as you will. Is that even a hard requirement or just something nice the compiler does to make life easier? For example, C was designed to be taken straight “off the wire” and compiled in a single stage with only keeping a symbol table around for bookkeeping. Sure, you can type check as you go but do you really have to?
- pornel 4y agoC 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.