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# 编译器是用哪种语言编写的?
基础教程推荐
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- SSE 浮点算术是否可重现? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 将 XML 转换为通用列表 2022-01-01