Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/branches/SMLNJ/src/compiler/README
ViewVC logotype

Annotation of /sml/branches/SMLNJ/src/compiler/README

Parent Directory Parent Directory | Revision Log Revision Log


Revision 24 - (view) (download)

1 : monnier 16 ============================================================================
2 : monnier 24 The Overall Structure of the Current FLINT/ML Compiler
3 :     <based On SML/NJ version 109.33 11/29/97>
4 :    
5 :    
6 :    
7 : monnier 16 ============================================================================
8 : monnier 24 The Overall Structure of the Current FLINT/ML Compiler
9 :     <based On SML/NJ version 109.31+ 9/22/97>
10 : monnier 16
11 :     NOTES
12 : monnier 24 Some informal half-baked notes. Just don't want to discard them.
13 : monnier 16
14 :     README
15 : monnier 24 This file which gives an overview of the compiler structure.
16 : monnier 16
17 :     all-files.cm
18 :     The standard Makefile for compiling the compiler. It is similar
19 :     to the idea of sources.cm used by CM.make, except that
20 : monnier 24 all-files.cm is designed for CMB.make only. The resulting binfiles
21 :     from doing CMB.make are placed in a single bin directory, eg.
22 :     bin.x86-unix or bin.sparc-unix. Right now, all-files.cm is
23 :     just whatever in sources.cm plus all the bootstrap glue files.
24 : monnier 16
25 : monnier 24 buildcm
26 :     Scripts for building the sml-cm version of the compiler.
27 : monnier 16
28 : monnier 24 buildcm2
29 :     Scripts for building a sml-cm compiler that knows to where to
30 : monnier 16 find the library and ml-lex and ml-yacc, etc. Need to adjust
31 : monnier 24 the top-level directory name there.
32 : monnier 16
33 :     sources.cm
34 :     This file contains the usual makefile for CM.make. It is not
35 :     used to build up the interactive compiler. But it can be
36 : monnier 24 useful for debugging purpose as doing CM.make immediately
37 :     build up a interactive visible compiler. Notice all the
38 :     bootstrap glue files are not here, because CM.make() does
39 :     run them which will cause problems.
40 : monnier 16
41 : monnier 24 xmakeml
42 :     Scripts for building the interactive compiler. The default path
43 :     of bin files is ./bin.$arch-$os. If you add the "-full" option,
44 :     it will build a compiler whose components are visible to the
45 :     top-level interactive environment.
46 : monnier 16
47 : monnier 24 xrun
48 :     Scripts for running the interactive copmiler.
49 : monnier 16
50 :     ============================================================================
51 :     Tips:
52 : monnier 24 To find a particular binding XXX, type
53 :     grep XXX */*.{sig,sml,lex,grm} */*/*.{sig,sml,lex,grm}
54 :     If you like, make the above into a script.
55 : monnier 16
56 :     0-Boot
57 : monnier 24 The SML97 Basis Library. When recompiling the compiler (via CMB.make),
58 :     files in this directory are always compiled first. Files in this directory
59 :     are compiled in the following order:
60 :     (0) build the primitive environment (from 3-Semant/prim/prim.sml)
61 :     (1) assembly.sig
62 :     (2) dummy.sml
63 :     (3) core.sml
64 :     (4) files in all-files.cm (following the exact order)
65 :     (5) files in pervasive.cm (following the exact order)
66 :    
67 : monnier 16 1-TopLevel/batch/
68 :     Utility files for the Compilation Manager CM and CMB;
69 :     1-TopLevel/bootstrap/
70 :     How to bootstrap an interactive compiler. Details are in boot.sml and
71 :     shareglue.sml. Before building an interactive compiler, one should have
72 :     already gotten a visible compiler (for that particular architecture),
73 :     see the viscomp directory. To build a compiler for SPARC architecture,
74 : monnier 24 all we need to do is the load and run the IntSparc (in sparcglue.sml)
75 : monnier 16 structure.
76 :     1-TopLevel/environ/
77 :     A top-level environment include static environment, dynamic environment
78 :     and symbolic environment. The definitions of static environments are in
79 :     the 3-Semant/statenv directory, as they are mostly used by the elaboration
80 :     and type checking.
81 :     1-TopLevel/interact/
82 :     How the top-level interactive loop is organized. The evalloop.sml contains
83 :     the details on how a ML program is compiled from source code to binary
84 :     code and then later being executed.
85 : monnier 24 1-TopLevel/misc/
86 :     Compiler control flags and version numbers are here.
87 : monnier 16 1-TopLevel/viscomp/
88 :     How to build the visible compiler viscomp --- this is essentially
89 : monnier 24 deciding what to export to the outside world.
90 : monnier 16
91 : monnier 24 2-FrontEnd
92 : monnier 16 Phase 1 of the compilation process. Turning the SML source code into
93 : monnier 24 the Concrete Synatx. The definition of concrete syntax is in ast.sml.
94 :     The frontend.sig and frontend.sml files contains the big picture on
95 :     how the lexer and parser are organized.
96 : monnier 16
97 :     3-Semant
98 : monnier 24 So-called semantic analysis, but really doing the elaboration and
99 :     type-checking of the core and module languages. The semantic objects
100 :     are defined in bindings.sml. The result is the Abstract Syntax, defined
101 :     in the absyn directory
102 :     3-Semant/absyn/
103 :     Definition of Abstract Syntax
104 : monnier 16 3-Semant/basics/
105 : monnier 24 Definition of semantic objects for the core language including type
106 :     bindings, value bindings, and constructor bindings.
107 :     3-Semant/bindings.sml
108 :     Top-level view of what semantic objects we have
109 : monnier 16 3-Semant/elaborate/
110 :     How to turn a piece of code in the Concrete Syntax into one in the
111 :     Abstract Syntax. The top-level organization is in the following
112 :     elabtop.sml file.
113 : monnier 24 3-Semant/elabtop.sml
114 : monnier 16 Top-level view of the elaboration process. Notice that each piece
115 :     of core-ML program is first translated into the Abstract Syntax,
116 :     and gets type-checked. The type-checking does change the contents
117 :     of abstract syntax, as certain type information won't be known
118 :     until type-checking is done.
119 :     3-Semant/modules/
120 :     Utility functions for elaborations of modules. The module.sig and
121 :     module.sml contains the definitions of module-level semantic objects.
122 :     3-Semant/pickle/
123 :     How to write the static environments into a file! This is important
124 :     if you want to create the *.bin file. It is also useful to infer
125 :     a unique persistant id for each compilation unit (useful to detect
126 :     the cut-off compilation dependencies).
127 : monnier 24 3-Semant/prim/
128 :     Here is the list of primitive operators and primitive types. All
129 :     are synthesized, and then later get put in the primEnv environment.
130 :     PrimEnv was used as the initial environment when elaborating files
131 :     in the 0-Boot directory.
132 : monnier 16 3-Semant/statenv/
133 :     The definition of Static Environment. The SC-ed version of Static
134 : monnier 24 Environment is used to avoid environment blow-up.
135 : monnier 16 3-Semant/typing/
136 :     The type-checking and type-inference code for the core-ML programs.
137 :     It is performed on Abstract Syntax and it produces Abstract Syntax
138 :     also.
139 :    
140 : monnier 24 4-Translate
141 : monnier 16 This phase translates the Abstract Syntax into the intermediate
142 :     Lambda language (i.e., FLINT). During the translation, it compiles
143 : monnier 24 the Pattern Matches (see the mcomp directory).
144 :     4-Translate/lambda/
145 :     Definition of the intermediate languages. How to type-check it
146 :     and how to print it.
147 :     4-Translate/mcomp/
148 :     Code for compiling pattern matches.
149 :     4-Translate/opt/
150 :     Code for optimization and representation analysis of the Lambda code.
151 :     4-Translate/plambda/
152 :     An older version of the Lambda language (not in the A-Normal form)
153 :     4-Translate/trans/
154 :     Translation of Abstract Syntax into the Lambda code. Of course, the
155 :     semantic objects used in the elaboration have to be translated into
156 :     the Lambda types as well.
157 :     4-Translate/type/
158 :     Definiton of the Lambda types, constructors and kinds. A bunch of
159 :     utility functions on how to manipulate the type environment, deBruijn
160 :     indices, etc.
161 :    
162 :     5-CPS
163 :     This phase turns the Lambda code into Continuation Passing Style,
164 :     does the closure conversion, and then feed it into the code generator.
165 :     5-CPS/clos/
166 : monnier 16 The closure conversion step. Check out Shao/Appel LFP94 paper for
167 : monnier 24 the detailed algorithm
168 :     5-CPS/conv/
169 :     Converting the Lambda code into the CPS code. The main nontrivial
170 :     step is the compilation of the Switch statement.
171 :     5-CPS/obsol/
172 : monnier 16 All files in this directory are currently not up-to-date. They are
173 :     either obsolete or are not compatible with recent changes made to
174 :     the CPS language.
175 : monnier 24 5-CPS/opt/
176 :     The CPS-based optimizations. Check out the Appel Compiling with
177 :     Continuation book for the details
178 :     5-CPS/spillgen/
179 :     This is the OLD code generator, currently used by the SPARC, MIPS,
180 :     RS6000 and X86 architectures. A counterpart of this is the new
181 :     code generator in the 7-NewCGen/cpscompile directory.
182 :     5-CPS/top/
183 :     The toplevel organization of all the above phases.
184 : monnier 16
185 : monnier 24 6-CodeGen
186 : monnier 16 The old code generator. May eventually go away after Lal's new
187 : monnier 24 code generator become stable. Each code generator should produce
188 :     a structure of signature CODEGENERATOR (defined in the
189 :     1-Toplevel/misc/codes.sig file)
190 :     6-CodeGen/bytecode/
191 :     These code might be obsolete. It is supposed to generate some
192 :     kind of byte code.
193 :     6-CodeGen/coder/
194 : monnier 16 This directory contains the machine-independent parts of the
195 :     old code generator. Some important signatures are also here.
196 : monnier 24 6-CodeGen/mips/
197 : monnier 16 MIPS code generator for both little endian and big endian
198 : monnier 24 6-CodeGen/rs6000/
199 : monnier 16 RS6000 code generator
200 : monnier 24 6-CodeGen/sparc/
201 : monnier 16 SPARC code generator
202 : monnier 24 6-CodeGen/x86/
203 : monnier 16 X86 code generator
204 :    
205 : monnier 24 7-NewCGen/MLRISC/
206 :     Lal George's new code generator ML RISC
207 :     7-NewCGen/alpha32/
208 : monnier 16 Alpha32 new code generator
209 : monnier 24 7-NewCGen/alpha32x/
210 : monnier 16 Alpha32 new code generator (with special patches)
211 : monnier 24 7-NewCGen/cpscompile/
212 : monnier 16 Compilation of CPS into the MLRISC abstract machine code
213 : monnier 24 7-NewCGen/hppa/
214 : monnier 16 HPPA new code genrator
215 :    
216 : monnier 24 9-Misc/
217 : monnier 16 Contains various kinds of utility programs
218 : monnier 24 9-Misc/bignums/
219 : monnier 16 Bignum packages. I have no clue how stable this is.
220 : monnier 24 9-Misc/print/
221 : monnier 16 Pretty printing. Very Adhoc, needs major clean up.
222 : monnier 24 9-Misc/profile/
223 : monnier 16 The time and the space profiler.
224 : monnier 24 9-Misc/util/
225 : monnier 16 Important utility functions including the Inputsource (for
226 :     reading in a program), and various Hashtable and Dictionary
227 :     implementations.
228 :     ============================================================================

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0