"Compiler as a service" in C# 4.0

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Jan 5 19:00:13 PST 2010


Jussi Jumppanen wrote:
> Nick Sabalausky Wrote:
> 
>> I thought C# compiling was already part of the .NET library...? 
> 
> It is.
> 
> Class: CSharpCodeProvider
> Namespace:  Microsoft.CSharp
> Assembly:  System (in System.dll)
> 
> Provides access to instances of the C# code generator and code compiler.
> 

The REPL in Hejlsberg's demo requires a bit more than what 
CSharpCodeProvider offers. Instead of compiling an entire file, the loop 
needs to compile a code snippet and save the resulting environment for 
further evaluations.

The changes in the compiler aren't huge, and the effect is quite nice.


Andrei



More information about the Digitalmars-d mailing list