C# 编译器是用哪种语言编写的?

In which language is the C# compiler written?(C# 编译器是用哪种语言编写的?)
本文介绍了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# 编译器是用哪种语言编写的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)