Stream: t-compiler/help

Topic: desugaring vs. lowering

Philipp Hansch (May 12 2019 at 10:29, on Zulip):

In AST->HIR and HIR->MIR conversion, the terms 'lowering' and 'desugaring' mean the same right? I've seen both used in various places and wasn't sure if there's a difference

davidtwco (May 12 2019 at 10:33, on Zulip):

Not an expert at all, but I've always thought of it as desugaring also includes some transformations (e.g. in the AST->HIR, ? is expanded into a match) whereas lowering is just converting from one representation to another.

Philipp Hansch (May 12 2019 at 10:47, on Zulip):

oh right, so IIUC lowering is the the general transformation and then there's additional desugarings on top like for loops and ?

oli (May 12 2019 at 11:09, on Zulip):

yes, that's correct. Lowering can be from ast::ExprKind::Binary to hir::ExprKind::Binary without any changes to representation

oli (May 12 2019 at 11:10, on Zulip):

desugaring always means some sort of expansion into a reduced set of possible representations

centril (May 12 2019 at 18:42, on Zulip):

Depending on context, "desugaring" sometimes also refers to an in-language desugaring.

Last update: Apr 05 2020 at 01:45UTC