Back to articles

Tag archive

#decompiler

D
Oct 10, 2026

Decompiling the dynamic keyword: reading call-site IL in Glass.NET

One line of C# with dynamic compiles into a cached call site, a binder, an array of argument-info flags and an invocation through a delegate field — a dozen members of generated scaffolding for a single method call. Here is what the compiler actually emits for dynamic dispatch, how a naive decompiler shows you the raw CallSite machinery, and how Glass.NET recognizes the pattern and gives you back the one line you wrote.

Oct 10, 20266 min read0 reactions0 comments
D
Oct 9, 2026

Decompiling string interpolation: reading the handler back to $"..."

Modern C# does not compile $"Hello {name}" into string.Format anymore — it lowers to a DefaultInterpolatedStringHandler with AppendLiteral and AppendFormatted calls. Here is exactly what that looks like in IL, how Glass.NET pattern-matches the sequence back into an interpolated string with its format and alignment intact, and the one case where it honestly cannot.

Oct 9, 20266 min read0 reactions0 comments