✅ What is C# Code Lowering?

Is there a cut and dry definition of what code lowering ("yoinking") encompasses? e.g.: - are top level statements "lowered" into a class/function? - are records "lowered" into class definitions? - are properties "lowered" into methods? Generally asking: What is code lowering in C#, where can I observe it or its effects in my code, and where can I read more about it? Thanks in advance!
9 Replies
Angius
Angius8mo ago
Sharplab can tell you what gets lowered into what
ryan
ryan8mo ago
1. Website: sharplab.io 2. ILSpy from Github: https://github.com/icsharpcode/ILSpy
GitHub
GitHub - icsharpcode/ILSpy: .NET Decompiler with support for PDB ge...
.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform! - icsharpcode/ILSpy
Angius
Angius8mo ago
To answer your questions, though: * yes * yes * no
SleepWellPupper
SleepWellPupperOP8mo ago
Thanks for the replies so far. Can I infer then that code lowering is simply the C#->C# transformation the compiler performs before actually compiling?
Angius
Angius8mo ago
Something like that, yeah
ryan
ryan8mo ago
Yes, This is exactly what they do, and ILSpy can also specify the corresponding version.
SleepWellPupper
SleepWellPupperOP8mo ago
The corresponding compiler version?
ryan
ryan8mo ago
Language version.
SleepWellPupper
SleepWellPupperOP8mo ago
Right. Thanks guys.

Did you find this page helpful?