In which language is the C# compiler written?(C# 编译器是用哪种语言编写的?)
问题描述
我查看了 http://referencesource.microsoft.com/ 的源代码,它出现了所有源代码都在 C# 中.
I looked at the source code at http://referencesource.microsoft.com/, and it appears all the source code is in C#.
我还查看了新 C# 编译器平台的源代码(Roslyn),它也在 C# 中.这怎么可能?C# 语言编译器是用 C# 编写的吗?还是我错过了一些明显的东西?如果 C# 编译器是用 C# 编写的,那么它是如何工作的?
I also looked at the source code for the new C# compiler platform (Roslyn), and it is also in C#. How is that possible? Is C# language compiler written in C#? Or am I missing something obvious? If C# compiler is written in C# then how does it work?
推荐答案
最初的 C# 编译器不是用 C# 编写的,而是用 C 和 C++ 编写的.新的 Roslyn 编译器是用 C# 编写的,但最初是使用旧编译器编译的.新编译器完成后,就可以编译自己的源代码:这称为 bootstrapping.
The original C# compiler wasn't written in C#, it was in C and C++. The new Roslyn compiler was written in C#, but was initially compiled with the old compiler. Once the new compiler was done, it was able to compile its own source code: this is called bootstrapping.
这篇关于C# 编译器是用哪种语言编写的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C# 编译器是用哪种语言编写的?


- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 输入按键事件处理程序 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- C# 中多线程网络服务器的模式 2022-01-01