Desugaring
Desugaring is the process in programming language implementation where syntactic sugar—syntax that is more convenient for humans but not essential to express computations—is translated into more primitive language constructs. The desugared form uses a small core language that the compiler or interpreter already handles directly.
The purpose of desugaring is to reduce the surface area that the rest of the system must
In practice, desugaring is performed as part of the compilation or interpretation pipeline, typically after parsing
Examples illustrate its role. JavaScript demonstrates many cases, such as for...of loops desugaring to calls to
Limitations exist. Desugaring assumes certain evaluation order and side-effect behavior; otherwise, semantics can change if the