4 ms·
First of all, deciding features and behaviors is not simple. :) There are a number of technical implementation challenges in the compiler. It is a large proje
by steveklabnik 7y ago
First of all, deciding features and behaviors is not simple. :)
There are a number of technical implementation challenges in the compiler.
It is a large project, and Rust's got a really intense stability policy.
The compiler was bootstrapped very early, when the rate of change of the language itself was still "multiple things per day." This introduced significant architectural debt.
There have been multiple projects that have re-written massive parts of the compiler, and more ongoing. For example, non-lexical lifetimes required inventing an entire additional intermediate language, re-writing the compiler to use it, and making sure that everything kept working while doing so.
More recently, the compiler has been being re-done from a classic, multiple-pass architecture to a more Roslyn, "query-based" one. Again, this is being done entirely "in-flight", while keeping a project that's used by a lot of folks stable. The rust-analyzer has made this project even more interesting; a "librarification" strategy is being undergone to make the compiler more modular.
For some numbers on this kind of thing, https://twitter.com/steveklabnik/status/1211667962379276288/photo/1 https://twitter.com/steveklabnik/status/1211667962379276288/... and https://twitter.com/steveklabnik/status/1211717308143587334/photo/1 https://twitter.com/steveklabnik/status/1211717308143587334/...
- Waterluvian 7y agoUsing the word "simply" is a quirk of mine. I'm very much trying to express that I think it's by far the hardest part. Thanks for your response!
- steveklabnik 7y agoIt's all good :) You're welcome!
- j88439h84 7y ago> Rust's got a really intense stability policy. I know the code won't stop running, but I wonder how soon it stops being idiomatic. If it's not idiomatic, it's harder to maintain due to unfamiliar style and structure. Does Rust have measures to deal with this issue?
- deleted 7y ago[deleted]
- steveklabnik 7y agoI think the closest thing is enforced rustfmt. I don't hack on the compiler though, so maybe there's some stuff that the team does that they don't broadcast super widely.
- j88439h84 7y agoI don't mean the code of the Rust compiler, I mean code written in Rust becomes unidiomatic as the idioms change. How fast does that happen, is it a problem, is it being addressed?
- steveklabnik 7y agoOkay, so hilariously, I thought you meant that at first, but re-read your comment, and said "oh, but we're talking about the compiler's maintenance and I mentioned how often the language is changing, so I must have misunderstood." Should have stuck with my gut! It is not a problem. A lot of processing steps go on before the meat of the work gets done; many new idioms end up boiling away entirely as part of this process. Like, the borrow checker doesn't even know about loops; by the time the code gets there, it's all been turned into plain old gotos. The further you get into the compiler, the simpler of a language it gets, and everything is defined in terms of sugar of the next IR down.
- ansible 7y agoAs it happens, Steve can provide some metrics for this: https://words.steveklabnik.com/how-often-does-rust-change https://words.steveklabnik.com/how-often-does-rust-change https://www.reddit.com/r/rust/comments/fz8mwm/how_often_does_rust_change/ https://www.reddit.com/r/rust/comments/fz8mwm/how_often_does...
- steveklabnik 7y agoI don't think this analysis really captures idiom questions, so while it's related, I'm not sure it's the right thing here :)