Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is the most interesting and promising approach to implement a compiler in C#?
    primarykey
    data
    text
    <p>I am just in the beginning of my graduation project that is supposed to last for 6 months. The goal of the project is to implement a .Net-compiler for one scripting language. I had the Compiler Construction as a subject in my curriculum and am aware of the basic steps how to implement a compiler in general, but we used Bison and simple compiler with GCC as back-end and thus I don't know much about implementing compilers on .Net platform.</p> <p>Having carried out some research on this topic I found the following alternative solutions for code generation (I am not talking about other essential parts of compiler, like a parser -- it is out of scope here):</p> <ol> <li>Direct code generation using <a href="http://msdn.microsoft.com/en-us/library/h0x241a0.aspx" rel="nofollow">Reflection.Emit</a>.</li> <li>Using <a href="http://ccimetadata.codeplex.com/wikipage?title=An%20Introduction%20to%20the%20Common%20Compiler%20Interface" rel="nofollow">Common Compiler Interface</a> abstraction over Reflection.Emit for automation of some code generation. </li> <li>Using <a href="http://www.15seconds.com/issue/020917.htm" rel="nofollow">CodeDOM</a> for C# and VB compilation at runtime.</li> <li>There is a new emerging C# "compiler as a service" called <a href="http://social.msdn.microsoft.com/forums/en-us/roslyn" rel="nofollow">Roslyn</a>, available as a CTP now.</li> <li><a href="http://msdn.microsoft.com/en-us/library/dd233052.aspx" rel="nofollow">DLR</a> offers support for dynamic code generation and has some interfaces for runtime code generation via expression trees etc.</li> <li>Mono is shipped with <a href="http://mono-framework.com/Cecil" rel="nofollow">Mono.Cecil</a> library that seems to have some functionality for code generation as well.</li> </ol> <p>The primary goal of my project is to delve deeper into the guts of .Net, to learn Compiler Construction and to get good grade for my work. The secondary goal is to come up with a compiler implementation that can be later opened to the community under a permissive open-source license. </p> <p>So, what would be a most interesting, educative, entertaining and promising approach here? I would have definitely tried all of them if I had some more time, but I need to submit my work in 6 months sharp to get a positive grade...</p> <p>Thank you in advance, Alexander.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload