Update to the site
[mono.git] / web / runtime
1 * The Mono runtime
2
3         The Mono runtime will implement the JIT engine (and a byte
4         code interpreter for quickly porting to new systems), the
5         class loader, the garbage collector, threading system and
6         metadata access libraries.
7
8         Currently the runtime has an image loader and metadata access
9         entry points.  The runtime comes with a simple interpreter
10         that can execute very simple programs. 
11
12 ** Executing MSIL/CIL images
13
14         The code will load an executable and map the references to
15         external assemblies to our own version of the assemblies on
16         GNU/Linux.
17
18         Our roadmap looks like this, this has been updated as of
19         <b>Jul 15, 2001</b>:
20
21         <ul>
22
23                 * Milestone 1: Fully read and parse all CIL byte-codes
24                   and metadata tokens (ie, a disassembler).
25
26                 * Milestone 2: Complete an interpreter for CIL byte
27                   codes.  This interpreter can be used temporarly to
28                   run CIL byte code on a system where no JIT is
29                   available.
30
31                 * Milestone 3: Define an <i>lburg</i> instruction
32                   selector for the JITer for Intel.  Although slower
33                   at JITing than a streaming JITer, it generates
34                   better code.  The same grammar can later be used for
35                   the stream jitter. 
36
37                 * Milestone 4: Implement JITer.
38
39                 * Milestone 5: Port of the JITer to non IA32 systems.
40         </ul>
41
42         A setup similar to the Kaffe JIT engine can be used to
43         layout the code to support non-IA32 architectures.  Our work
44         will be focused on getting a IA32 version running first.  
45
46         The JIT engine should work on Linux and Win32, although you
47         will need to install the CygWin32 development tools to get a
48         Unix-like compilation environment.
49
50 ** JIT Engine (<b>updated, Jul 14th, 2001</b>)
51
52         We will be using a code-generator generator approach for our
53         JITer.  Given the properties of CIL byte codes, we can take
54         full advantage of a real instruction selector for our code
55         generator. 
56
57         There are a couple of books that deal with this technique: "A
58         Retargetable C Compiler" and "Advanced Compiler Design and
59         Implementation" are good references.  You can also get a
60         technical description of <a
61         href="http://research.microsoft.com/copyright/accept.asp?path=http://www.research.microsoft.com/~drh/pubs/iburg.pdf&pub=ACM">lbrug</a>
62
63         Previously we had looked at a number of JIT engines and tools,
64         but they would not take full advantage of the CIL properties: 
65
66         <ul>
67                 * <a
68                   href="http://www.intel.com/research/mrl/orp/">ORP</a>
69
70                 * <a
71                   href="http://www.gnu.org/software/lightning/">GNU
72                   Lightning</a>
73
74                 * href="http://www.eecs.harvard.edu/~nr/toolkit/">NJ Machine
75                   Toolkit</a>.).
76
77                 * VCODE.
78         </ul>
79
80 ** Garbage Collection
81
82         We have decided to implement a generational tracing garbage
83         collector, which is very similar to the one being used by
84         .NET.  For an introduction to the garbage collection system
85         used by Microsoft's CLR implementation, you can read this book
86         on <a
87         href="http://www.amazon.com/exec/obidos/ASIN/0471941484/o/qid=992556433/sr=2-1/ref=aps_sr_b_1_1/103-5866388-0492603">Garbage
88         Collection.</a>
89
90         Although using a conservative garbage collector like Bohem's
91         would work, all the type information is available at runtime,
92         so we can actually implement a better collector than a
93         conservative collector.
94
95         <ul>
96                 * Garbage collection list and FAQ:<br>
97                   <a href="http://www.iecc.com/gclist/">http://www.iecc.com/gclist/</a>
98
99                 * The Microsoft .NET Garbage Collection Implementation:<br>
100                   <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI.asp</a>
101                   <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI.asp</a>
102         </ul>
103
104 ** Useful links
105
106         Paolo Molaro found a few interesting links:
107
108         <ul>
109
110                 * On compilation of stack-based languages:<br>
111                 <a href="http://www.complang.tuwien.ac.at/projects/rafts.html">
112                 http://www.complang.tuwien.ac.at/projects/rafts.html</a>
113
114                 * A paper on fast JIT compilation of a stack-based language:<br>
115                   <a href="http://www.research.microsoft.com/~cwfraser/pldi99codegen.pdf">
116                   http://www.research.microsoft.com/~cwfraser/pldi99codegen.pdf</a>
117
118                 * Vmgen generates much of the code for efficient virtual machine (VM)
119                   interpreters from simple descriptions of the VM instructions:<br>
120                   <a href="http://www.complang.tuwien.ac.at/anton/vmgen/">
121                   http://www.complang.tuwien.ac.at/anton/vmgen</a>
122         </ul>
123
124 ** PInvoke
125
126         PInvoke will be supported, and will be used to wrap Unix API
127         calls, these in turn are required for reusing some of the
128         GNOME libraries that will reduce the work we have to do to
129         deliver a complete class library.
130
131         To implement PInvoke we are looking into using the <a
132         href="http://sources.redhat.com/libffi">Foreign Function
133         Interface</a> Library from Cygnus.