[Mono-list] Questions mostly about IL asembler
Miguel de Icaza
miguel@ximian.com
02 Aug 2001 13:29:44 -0400
Hello Nick,
Please get in touch with Sergey, as he is also interested in
working on this (serge@wildwestsoftware.com):
> 1) When referring to IL byte code files, are we talking about
> human-readable text files with “.assembly”,
> “.entrypoint”, etc. commands in them? Is this what
> the IL assembler would parse and “compile” into a PE
> file? The PE file would contain binary data (just like
> exe’s and dll’s now) that would not be human
> readable? Am I understanding this correctly?
The idea is to take CIL source code and generate PE-COFF with the byte
codes.
This is really simple using C# and the System.Reflection.Emit.
> 2) Miguel, you want the IL assembler to be written in C#? If this
> is true, are there any parts of the C# tokenizer or compiler that
> can be re-used for that?
You might want to write your own tokenizer. A complete new parser
will be required.
> 3) You used your port of Jay for the C# compiler, but on the website
> you say you want to move to Bison. However, Bison can only produce C
> or C++ files right now. Which do you prefer, using Jay for Ilasm
> now, or waiting for some other Bison/C# solution?
Jay.cs was a port of Yacc to Java; I later ported it to C#.
Bison is better than Jay, but uses the same syntax and has the same
effects (modulo a few details). So we will be porting `JB' which is a
Bison for Java to be Bison for C#.
The bottom line is: use Jay for now.
> 4) I take it from other posts that Portable.net’s ilsam
> solution is not appropriate for Mono? Why is that, or have I
> misunderstood?
In reality, Mono does not even need an assembler to create executables
because we use System.Reflection.Emit (btw, last night I got the first
"image" built, with only empty interfaces on it).
It is a low priority item, but it will be useful for people who:
* Write IL source code.
* GUI front-ends that might want to integrate compilation of
both .cs, and .il
* Complete the SDK.
Miguel.