CoreCLR中超過3萬行代碼的gc.cpp文件的來源


在CoreCLR的開源代碼中,GC的主要實現代碼gc.cpp文件大小竟然有1.17MB,打開文件一看,竟然有35490行!第一次見到如此多行的單個代碼文件。

github都不讓直接查看:https://github.com/dotnet/coreclr/blob/master/src/gc/gc.cpp

為什么會有這么大的代碼文件?微軟的哪位大神在這樣的代碼海洋中游弋?不禁讓人產生好奇。

在 Hacker News 的回復中發現了線索(CoreCLR is now open source):

> I guess it's no surprise that microsoft software has a human-edited source file that's over 35000 lines...

IIRC, it was originally machine-generated... from LISP code written by David Bacon, under contract from the then-GC owner Patrick Dussud.

也許是從LISP代碼生成的C++代碼。

接下來的回復中提供了一篇博客的鏈接:

http://blogs.msdn.com/b/patrick_dussud/archive/2006/11/21/how-it-all-started-aka-the-birth-of-the-clr.aspx 

(How It All Started…AKA the Birth of the CLR)

文中的一段文字證實了這一點:

I designed the architecture of the runtime and wrote the Garbage Collector (and yes the GC prototype was was written in Common Lisp first and I wrote a translator to convert it to C++).

果然開始是用Lisp寫的,然后轉換為了C++代碼。

而博文的作者Patrick Dussud就是他寫了轉換程序將Lisp代碼轉換為C++代碼。 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM