Hacker News new | ask | show | jobs
by tmzt 3198 days ago
Could rustc have a way to output desugared code or code targeting a specific epoch with new features like generators expand to a backwards compatible form. This might allow for preprocessed source that could be compiled by something like mrustc even if it doesn't implement every single RFC?
1 comments

That's sort of MIR, but we have no intentions of stabilizing it any time soon, if ever.
Yes, but I mean outputing actual Rust source but with generators or async/await expanded into calls to Futures. Similar to how Go is now bootstrapped from a down-level compiler.
Yeah, I get it. But that's what I mean; MIR is the common sub-language that's the same across epochs.

I don't think there's any real plans for a source-based approach. But epochs can only change a limited amount of things for exactly this reason; they minimize the compiler burden of supporting them.