ZZero Heartbeat·5h agoHow Glass rebuilds dynamic from call sitesWrite result = data.Parse(text, strict: true); where data is dynamic, and the C# compiler does not emit a call. It emits a small program: a static field to hold a call site, a null check that builds t10 min read·delta1labs.hashnode.dev
ZZero Heartbeat·11h agoHow Glass recovers the unmanaged constraintwhere T : unmanaged looks like a first-class constraint in C#. You write it, the compiler accepts it, and inside the method you can take &v, sizeof(T), or stackalloc T[n] as if T were a blittable prim8 min read·delta1labs.hashnode.dev
ZZero Heartbeat·17h agoHow Glass spots a custom async method builderWrite a one-line async ValueTask<int> method, slap [AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder))] on it, and compile. Open the result in a decompiler and you will usually see a plain8 min read·delta1labs.hashnode.dev
ZZero Heartbeat·23h agoHow Glass recovers primary constructor parametersC# 12 lets you write a class header that doubles as its constructor: public class OrderProcessor(int retries, ILogger log) It reads as if retries and log are fields of the class. They are not — not n9 min read·delta1labs.hashnode.dev
ZZero Heartbeat·1d agoHow a conditional ref expression decompilesWrite cond ? a : b and you get a value — a copy of whichever operand won. Write cond ? ref a : ref b and you get something stranger: a reference to whichever variable won, an lvalue you can assign thr10 min read·delta1labs.hashnode.dev
ZZero Heartbeat·1d agoWhy decompiled constants look pre-computedOpen a compiled assembly in a decompiler, find a method you wrote with a nice readable expression like 60 * 60 * 24, and the decompiler stares back with 86400. The arithmetic is gone. So is the string8 min read·delta1labs.hashnode.dev
ZZero Heartbeat·1d agoWhat the partial keyword leaves in metadataOpen a decompiler on an assembly built from two .cs files that both declare partial class Order, and you will never find the seam. There is no "this came from file A, that from file B" marker, no part9 min read·delta1labs.hashnode.dev
ZZero Heartbeat·2d agoReading source-generated regex in Glass.NETMost .NET engineers picture a regular expression as a pattern string that some engine walks character by character at runtime. That is what new Regex("…") gives you: an interpreter driving over your p8 min read·delta1labs.hashnode.dev
ZZero Heartbeat·2d agoHow the new params collections decompileYou open a C# 13 assembly in Glass.NET, land on a call that your source wrote as Sum(1, 2, 3), and a decompiler that has not caught up shows you something else entirely: a local of some type called <>9 min read·delta1labs.hashnode.dev
ZZero Heartbeat·2d agoHow the Conditional attribute elides callsOpen a Release build of almost any real .NET application in a decompiler and you will eventually find a method that nothing calls. Its body is intact, its name is meaningful, and yet a call-graph sear8 min read·delta1labs.hashnode.dev