Linked by Thom Holwerda on Thu 19th Nov 2009 15:29 UTC, submitted by AlexandreAM
Post a Comment
With the opening of the compilers, Microsoft will move away from a "black box" mode and let developers see what is going on inside
The lack of a "let developers touch..." phrase is notable. I'm going to guess that this will be "open" for suitably constrictive definitions of "open".
The compiler services are already part of the .Net core libraries. You can already compile assemblies and executables on the fly - I have even done this to implement a sandboxed scripting service for a product we have. All of the ASP.Net stuff uses the compilers in this way if you do not pre-compile them.
Sure, you can compile source code to .NET assemblies, but that just calls the native compiler (source file(s) -> assembly file). The new compiler-as-a-service gives you access to the AST in memory. You'll be able to use the official parser for C#/VB instead of writing your own, if you need to analyze source code (or modify the AST before compiling it down to MSIL).
Sure, you can compile source code to .NET assemblies, but that just calls the native compiler (source file(s) -> assembly file).
Well, that is just semantics... the Compiler Services are not "an executable" and you don't "just call the native compiler" per se.
For most users of .Net, this doesn't really give an awful lot that wasn't available before - unless it packages it up more pleasantly. I don't need to write a compiler - it already exists. However, I do need to compile code on the fly - and I've been able to do that since .Net 2.0 using the compiler services. I happily compile code my users write to complete simple computation rules and cache the rules assembly when needed (or sometimes it just sits in memory and never hits the hard drive directly.)



