Shared Source CLI
At some point, I realized I’d developed a fascination with reading source code. I’ve dabbled in MFC, CRT, STL, Java VM, compilers, Linux, WINE on Linux, Windows CE, Boost, ACE, even the leaked Windows source code. While I can’t fully understand everything, every time I discover some little secret hidden in the code, it brings me immense joy. Perhaps this echoes Hou Jie’s words in “STL Source Code Analysis”: “Before source code, there are no secrets.”
In 2002, Microsoft suddenly had a change of heart and open-sourced part of .NET, calling it SSCLI. Though it’s only a portion and they claim it differs significantly from the commercial .NET Framework, it still satisfies my intense curiosity for peeking under the hood. Unfortunately, the SSCLI codebase is vast and complex, and the built-in documentation is vague and unclear. Studying it alone yielded little progress. Last winter break, after a whole semester, I barely scratched the surface — partly because my skills weren’t good enough to understand some things, and partly due to the lack of systematic resources. Newsgroups and downloaded PPTs only showed fragments, making it hard to get a comprehensive understanding. Later I considered making SSCLI my graduation thesis topic, but I’d already sold myself to the graduate school, and some things were out of my control. My thesis ended up being something I don’t even want to talk about…
Last year, I heard about a book that’s supposedly the definitive resource for studying SSCLI. But after waiting a year, no Chinese translation or reprint appeared. In June 2004, I asked a friend to buy it from Amazon overseas, but he found it was such a great book that he kept it for himself! Fortunately, I had three classmates interning in the US. Thanks to Jiang Feng, who bought the original $34.95 book for me at $17.85. With shipping and tax, it came to $21.34 — about 200 RMB, quite reasonable. Now that their internship is over, after many twists and turns, I finally got to see the book last night.
The book has nine chapters. Although it’s in English, it’s fairly accessible. I read the first chapter yesterday, and the biggest gain was recalling so many things. AppDomain, Strong Name, Common Type System, GAC… These familiar terms from a year ago were pulled back from the corners of my memory. Yes, since I left Microsoft in February last year, it’s been nearly a year since I’ve seriously studied .NET. The .NET Framework 2.0 beta came out, ASP.NET and C# also have 2.0 versions, but I haven’t systematically learned any of them. Most of my energy went to Windows CE and boring grad school courses. Maybe I’ve forgotten some of the details. But I feel that my understanding of the entire .NET architecture is deeply embedded in my mind and will never be erased. Perhaps this is what remains after the “lord of forgetting” has passed — the accumulation. I want to read this book properly — to recall more details, to commemorate my past efforts with .NET, to better study the new version of .NET, and to remember those unforgettable days of my youth…
At 2 AM, I woke up groggily to find myself still in my clothes, asleep on the bed, the book still clutched in my arms. It’s been a long time since I’ve experienced days like this :)