[Mono-dev] C# source-to-source compiler

Liang, Qichang (梁启昌) kcleung.sourceforge at gmail.com
Fri Nov 5 03:51:56 EDT 2010


Thanks!   Raphael said exactly the same thing to me.  Now I have two questions:

- How much does the async stuff in C# 5.0 resemble the Cilk spawn-sync
model?  And how much async stuff is implemented in the mono trunk?

- I don't know anything about CIL other than it is roughly equivalent
to Java bytecode -which Raphael told me it isn't and CIL is kind of a
low-level OO language on its own!

- Now I need to understand more about CIL, could you please point me
materials to start?  Also what is the relationship between CIL and
Java / LLVM bytecode?

Thanks again for your help!

Qichang

On Fri, Nov 5, 2010 at 6:08 PM, jmalcolm <malcolm.justin at gmail.com> wrote:
>
>
> kcleung wrote:
>>
>>
>> I am also looking for developing C#-based language extension, which
>> the compiler will compile to C# 4.0 code that calls *my* runtime
>> library.  The emitted C# 4.0 code will then go to the original dmcs
>> compiler, which will then produce CLI bytecode.
>>
>> Thanks!
>>
>> Qichang
>>
>>
>
> I guess I am also confused as to why you would need to have C# to C# as an
> intermediate step.
>
> Are you thinking that you would want to manually edit and maintain the
> generated C#?  I mean are you really seeing your modified C# as a Domain
> Specific Language (DSL) that is really just a code generator?
>
> It would seem easier to modify the C# compiler to directly generate CIL
> (Common Intermediate Language) that calls your runtime library.
>
> You can call your runtime library from CIL just as easily as you can from C#
> code.  The C# compiler already spits out CIL.  Just modify it to spit out
> CIL that calls into your runtime library.  This will be much easier than
> what you are proposing.
>
> I am not sure how familiar you are with CIL.  It is what all .NET languages
> like C#, Visual Basic, and Boo are compiled down to.  It is often described
> to be like assembly language but it really is not.  It is really a pretty
> high-level OO language in it's own right.
>
> CIL is like assembly in that it lacks many structured language features,
> like looping constructs, and instead uses jumps and conditional branches
> (like goto and if statements if you like) to achieve equivalent results.
> However, it is fully object-oriented and supports classes, fields, and
> methods with full support for inheritance, polymorphism, and virtual
> methods.  Access levels like public and private or modifiers like static
> (singleton) are all supported as well.  It also has a wide range of
> operators and a complex type system with integers, floating point types, and
> even arrays and generics.  CIL has full access to the .NET framework and
> method calls are by name and argument signature.  You can easily call into
> your library from CIL just as you would from C#.
>
> I do not believe that you need to have C# as an intermediate step.
> --
> View this message in context: http://mono.1490590.n4.nabble.com/C-source-to-source-compiler-tp3026549p3028181.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>


More information about the Mono-devel-list mailing list