c# - 当 C# 编译器是用 C# 编写的时,是否可以修改它?

标签 c# .net compiler-construction

我想知道是否可以为了方便而实现一些新功能。

当它出来时,这可能吗?

C# 5.0:编译器即服务:

http://www.matthewlefevre.com/blog/entry.php/c-40-and-c-50/368

最佳答案

Anders Hejlsberg 说:

It is one of the directions we are looking at for future versions of C#. Indeed, I see meta-programming as a piece of our bigger “Compiler as a Service” theme that we are working on for a future release. We want to open up our compiler so it becomes an API you can call to compile a piece of code and get back expression trees and/or IL. This enables a whole host of scenarios, such as application programmability, an interactive prompt, user-written refactorings, and domain specific languages that have little islands of C# imbedded in them.
Source

他还在其他地方(在一次 Channel9 采访中)表示,他们正在将 C# 编译器的核心移植到托管代码,以实现这一点。

有一个demo这可从上一个 PDC 获得。 C# 编译器确实是托管代码。

关于c# - 当 C# 编译器是用 C# 编写的时,是否可以修改它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/988623/

相关文章:

.net - 在云上部署 .NET Windows 应用程序

c# - FtpWeb请求 : The remote server returned an error: (530) Not logged in

delphi - 编译器指令 - Delphi 版本

c# - 在 Windows 10 中向 Text to Speech Engine 添加新声音

c# - CodeFile ="Registration.aspx.cs"可以在aspx页面的这一行添加多个partial classes文件

c# - InfoPath C# 中的权限类

java - 如果不在类文件中,编译后的代码将存储在哪里

C# 构造函数基关键字

c# - .net 中可以读取的文件的最大大小

java - 面向对象编程语言的 AST(抽象语法树)是什么样的?