After reading this article about Roslyn. I came across two things that i did not understand.
- deconstructed compiler
- C# gains a dynamic language's ability to generate and invoke code at runtime via Roslyn
I have searched a lots of posts on stack overflow and googled for it. but could not get the whole picture.
Can anyone please explain to me or direct me with some links and resources about these topics.
Taken from the linked article:
The part of:
...is just a very wrong assumption made by the blog post author...
Compiling code from an application doesn't turn C# into a dynamic language or it doesn't turn new C# compiler in a substitute of an interpreter...
C# was able to generate code at run-time since its inception using Reflection Emit. It seems like the new compiler didn't add that feature, but anyway it's easier to generate code from regular C# code with the new compiler than using Reflection Emit. In addition, as @hvd has noted in some comment, it was also possible since C# inception using
CSharpCodeProvider.C#, since .NET 4.0, can interoperate with dynamic languages using the Dynamic Language Runtime, which was created to open the door to interpreted language implementations on top of .NET (and also to make COM interop easier...).
About the other question (the thing about deconstructed compiler), it means that the new C# compiler allows you to hook other code to perform actions based on C# compilation steps.
I would take a look at Roslyn Overview on GitHub where there're a lot of details that should give more depth on the topic.