我已经开始阅读有关Roslyn"的新 C# 编译器,并想知道 Roslyn 编译器是如何编译的?我知道需要 boostrapping 才能获得 "自托管编译器",我想知道 Roslyn 编译器是如何引导"的?
I've started reading about "Roslyn" the new C# compiler and was wondering how was the Roslyn compiler compiled? I understand that boostrapping is needed in order to have "self hosting compiler", and I wondered how was the Roslyn compiler "bootstrapped"?
推荐答案这是 C# 团队实际上(不是猜测)完成的,根据埃里克·利珀特:
This is how it was actually (not guessing) done by the C# team, according to Eric Lippert:
C# 1.0 到 5.0 编译器是用 C++ 编写的.很长一段时间——一年多——我们用 C# 编写了 Roslyn C# 编译器,并用 C# 4.0 编译它.(C# 5.0 是由姐妹团队并行开发的.)那天我们可以编译 Roslyn 编译器,然后右转并使用我们刚刚构建的编译器再次编译它,那是快乐的一天.
C# 1.0 through 5.0 compilers were written in C++. For quite a long time -- over a year -- we wrote the Roslyn C# compiler in C# and compiled it with C# 4.0. (C# 5.0 was being developed in parallel by a sister team.) The day that we could compile the Roslyn compiler, and then turn right around and compile it again using the compiler we'd just built, that was a happy day.
Mads Torgersen 关于引导编译器的商业案例的好文章:
最后是我们的价值主张:让世界上只需要一个理解 C# 的代码库,所有想要通过代码构建工具的人都可以共享它!"
"Here, finally was our value proposition: Make it so that there only needs to be one code base in the world that understands C#, shared by everyone who wants to build tools over code!"
更多推荐
Roslyn C# 编译器是如何引导的?
发布评论