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

SCM Repository

[smlnj] Diff of /sml/trunk/src/system/README
ViewVC logotype

Diff of /sml/trunk/src/system/README

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 497, Tue Dec 7 15:44:50 1999 UTC revision 498, Tue Dec 7 15:44:50 1999 UTC
# Line 26  Line 26 
26          - cm-hook.cm    - an internal library for organizational purposes          - cm-hook.cm    - an internal library for organizational purposes
27          - cm-lib.cm     - the library that implements CM's functionality          - cm-lib.cm     - the library that implements CM's functionality
28          * comp-lib.cm   - a helper library for the compiler, MLRISC, and CM          * comp-lib.cm   - a helper library for the compiler, MLRISC, and CM
29          * host-cm.cm    - the library that exports the public interface to          * full-cm.cm    - the library that exports the public interface to
30                            the compilation manager (i.e., structure CM)                            the compilation manager (i.e., structure CM)
31            * minimal-cm.cm - exports a reduced version of structure CM;
32                              this one is pre-registered at the top level
33          * host-cmb.cm   - the library that exports the public interface to          * host-cmb.cm   - the library that exports the public interface to
34                            the bootstrap compiler (i.e., structure CMB)                            the bootstrap compiler (i.e., structure CMB)
35          - host-compiler-0.cm          - host-compiler-0.cm
# Line 39  Line 41 
41                            (In fact, its the "root" of the main hierarchy.)                            (In fact, its the "root" of the main hierarchy.)
42          * ml-yacc-lib.cm - needs no further comment          * ml-yacc-lib.cm - needs no further comment
43          * smlnj-lib.cm  - needs no further comment          * smlnj-lib.cm  - needs no further comment
44            * <arch>-compiler.cm - exports the Compiler structure for the
45                               given architecture (<Arch>Compiler).
46            * <arch>-<os>.cm - exports <Arch><OS>CMB for the given architecture-
47                               OS combination.
48          * target-compilers.cm          * target-compilers.cm
49                          - library exporting target-specific versions of                          - library exporting target-specific versions of
50                            structure Compiler and of structure CMB                            structure Compiler and of structure CMB.
51                            (The existence of this library is the moral                            This is a summary of all the <arch>-compiler.cm
52                              and <arch>-<os>.cm libraries above.
53                              (The existence of these libraries is the moral
54                             equivalent of "CMB.retarget" in the old CM.)                             equivalent of "CMB.retarget" in the old CM.)
55          * viscomp-lib.cm - library that implements the compiler          * viscomp-core.cm - library that implements the machine-independent
56                            (At the moment, its interface is rather thin.  We                            core of the compiler.
57                             should think about how to structure the interface          * viscomp-<arch>.cm - library that implements the visible compiler
58                             in such a way that it becomes a useful equivalent                             for a given architecture.
                            to the old "full" compiler.)  
59    
60  * Before you can use the bootstrap compiler (CMB)...  * Before you can use the bootstrap compiler (CMB)...
61  ----------------------------------------------------  ----------------------------------------------------
# Line 90  Line 97 
97  CMB.deliver must also build the remaining files -- files that are part  CMB.deliver must also build the remaining files -- files that are part
98  of libraries to be stabilized but which are not used by the compiler.  of libraries to be stabilized but which are not used by the compiler.
99    
100    You can reduce the number of extra files compiled and stabilized
101    during CMB.deliver at the expense of not building any cross-compilers.
102    For that, say
103            #set (CMB.symval "LIGHT") (SOME 1);
104    before running CMB.deliver.
105    
106  After you have made the boot directory, if you want to continue  After you have made the boot directory, if you want to continue
107  developing the compiler (i.e., make changes to some sources,  developing the compiler (i.e., make changes to some sources,
108  recompile, etc.), you must first get rid of that boot directory.  recompile, etc.), you must first get rid of that boot directory.
# Line 104  Line 117 
117    
118          <prefix>.boot.<arch>-<os>          <prefix>.boot.<arch>-<os>
119    
120  respectively, with "comp" being the default for <prefix>.  To change  respectively, with "sml" being the default for <prefix>.  To change
121  the prefix, use CMB.make' and CMB.deliver' with the new prefix  the prefix, use CMB.make' and CMB.deliver' with the new prefix
122  provided as the optional string argument to these functions.  provided as the optional string argument to these functions.
123    
# Line 113  Line 126 
126    
127  The heap image is made by running the "makeml" script that you find  The heap image is made by running the "makeml" script that you find
128  here in this directory.  By default it will try to refer to the  here in this directory.  By default it will try to refer to the
129  comp.boot.<arch>-<os> directory.  You can change this using the -boot  sml.boot.<arch>-<os> directory.  You can change this using the -boot
130  argument (which takes the full name of the boot directory to be used).  argument (which takes the full name of the boot directory to be used).
131    
132  The "feel" of using makeml should be mostly as it used to.  However,  The "feel" of using makeml should be mostly as it used to.  However,
# Line 149  Line 162 
162  image.  The "testml" script that you also find here will run the heap  image.  The "testml" script that you also find here will run the heap
163  image and instruct it to look for its libraries in that new library  image and instruct it to look for its libraries in that new library
164  directory.  directory.
165  "testml" takes the name of the heap image as its single argument.  It  
166  expects the library directory to be the one that makeml builds.  "testml" takes the <prefix> of the heap image as its first
167    argument. All other arguments are passed verbatim to the ML process.
168    
169    The <prefix> is the same as the one used when you did "makeml".  If
170    you run "testml" without arguments, <prefix> defaults to "sml".
171    Thus, if you just said "makeml" without argument you can also say
172    "testml" without argument.  (Note that you _must_ supply the <prefix>
173    argument if you intend to pass any additional arguments.)
174    
175  * Installing a heap image for more permanent use  * Installing a heap image for more permanent use
176  ------------------------------------------------  ------------------------------------------------
177    
178  Since you have been using the new CM already, it can be assumed that  You can "install" a newly generated heap image by replacing the old
179  you have already set up a correct pathname configuration.  (For more  image with the new one _AND AT THE SAME TIME_ replacing the old stable
180  information on pathname configurations, see below.)  With a correct  libaries with the new ones.  To do this, run the "installml" script.
181  pathname configuration in place, you can "install" a newly generated  
182  heap image by replacing the old image with the new one _AND AT THE  Like "testml", "installml" also expects the <prefix> as its first
183  SAME TIME_ replacing the old stable libaries with the new ones.  argument.  <prefix> defaults to "sml" if no argument is specified.
184    
185    "installml" patches the ../../lib/pathconfig file to reflect any
186    changes or additions to the path name mapping.
187    
188    Thus, after a successful CMB.deliver, you should say
189    
190            ./makeml
191    
192    to make the new heap image + libraries, then
193    
194            ./testml
195    
196    to make sure everything works, and finally
197    
198            ./installml
199    
200    to replace your existing compiler with the one you just built and tested.
201    
202  * Cross-compiling  * Cross-compiling
203  -----------------  -----------------
# Line 194  Line 231 
231  (PPCMacOSCMB is not very useful at the moment because there is no  (PPCMacOSCMB is not very useful at the moment because there is no
232  implementation of the basis library for the MacOS.)  implementation of the basis library for the MacOS.)
233    
234    Alternatively, you can select just the one single structure that you
235    are interested in by auto-loading <arch>-compiler.cm or <arch>-<os>.cm.
236    <arch> currently ranges over "alpha32", "hppa", "ppc", "sparc", and "x86.
237    <os> can be either "unix" or "macos" or "win32".
238    (Obviously, not all combinations are valid.)
239    
240  * Path configuration  * Path configuration
241  --------------------  --------------------
242    
# Line 218  Line 261 
261  in the path can upset the program that hopes to find something under  in the path can upset the program that hopes to find something under
262  the same name later on the path.  Even when ignoring security-issues  the same name later on the path.  Even when ignoring security-issues
263  like trojan horses and such, this definitely opens the door for  like trojan horses and such, this definitely opens the door for
264  various unpleasant surprises.  (Who has not ever named a test version  various unpleasant surprises.  (Who has never named a test version
265  of a program "test" an found that it acts strangely only to discover  of a program "test" an found that it acts strangely only to discover
266  later that /bin/test was run instead?)  later that /bin/test was run instead?)
267    
# Line 249  Line 292 
292    
293  During compilation of the compiler, CMB uses a path configuration that  During compilation of the compiler, CMB uses a path configuration that
294  is read from the file "pathconfig" located here in this directory.  is read from the file "pathconfig" located here in this directory.
 Warning: The names in that pathconfig file are relative pathnames and  
 will work only if you are in this directory.  (This will typically be  
 the case since you are compiling the compiler. Normally, however, path  
 configurations should map anchors to absolute pathnames.)  
295    
296  At bootstrap time, the same anchors are mapped to the corresponding  At bootstrap time, the same anchors are mapped to the corresponding
297  sub-directory of the "boot" directory: basis.cm is mapped to  sub-directory of the "boot" directory: basis.cm is mapped to
298  comp.boot.<arch>-<os>/basis.cm -- which means that CM will look for a  sml.boot.<arch>-<os>/basis.cm -- which means that CM will look for a
299  library named comp.boot.<arch>-<os>/basis.cm/basis.cm -- and so forth.  library named sml.boot.<arch>-<os>/basis.cm/basis.cm -- and so forth.
300    
301  By the way, you will perhaps notice that there is no file  By the way, you will perhaps notice that there is no file
302          comp.boot.<arch>-<os>/basis.cm/basis.cm          sml.boot.<arch>-<os>/basis.cm/basis.cm
303  but there _is_ the corresponding stable archive  but there _is_ the corresponding stable archive
304          comp.boot.<arch>-<os>/basis.cm/CM/<arch>-<os>/basis.cm          sml.boot.<arch>-<os>/basis.cm/CM/<arch>-<os>/basis.cm
305  CM always looks for stable archives first.  CM always looks for stable archives first.
306    
307  This mapping (from anchors to names in the boot directory) is the one  This mapping (from anchors to names in the boot directory) is the one
# Line 294  Line 333 
333    
334  For example, I always keep my "good" libraries in `pwd`/../../lib --  For example, I always keep my "good" libraries in `pwd`/../../lib --
335  where both the main "install" script and the "installml" script (see  where both the main "install" script and the "installml" script (see
336  below) also put them -- so I don't have to do anything special about  above) also put them -- so I don't have to do anything special about
337  my pathconfig file.  my pathconfig file.
338    
339  Once I have new heap image and libraries working, I replace the old  Once I have new heap image and libraries working, I replace the old
# Line 311  Line 350 
350  this task.  Using the script has the added advantage that it will not  this task.  Using the script has the added advantage that it will not
351  clobber libraries that belong to other than the current architecture.  clobber libraries that belong to other than the current architecture.
352  (The rather heavy-handed "rm/mv" approach above will delete all stable  (The rather heavy-handed "rm/mv" approach above will delete all stable
353  libraries for all architectures.)  libraries for all architectures.)  "installml" also patches the
354    ../../lib/pathconfig file as necessary.
355    
356  Of course, you can organize things differently for yourself -- the  Of course, you can organize things differently for yourself -- the
357  path configuration mechanism should be sufficiently flexible.  path configuration mechanism should be sufficiently flexible.
# Line 359  Line 399 
399  keyword.  If the specification is missing (that's the "old" syntax),  keyword.  If the specification is missing (that's the "old" syntax),
400  then the the owner will be taken to be the interactive toplevel.  then the the owner will be taken to be the interactive toplevel.
401    
 There are several examples of this throughout the system's source  
 hierarchy.  One notable case is MLRISC.  It should probably be made  
 into a library of its own, but I leave this job to Lal.  At the moment  
 MLRISC.cm is a sub-group of viscomp-lib.cm.  
   
402  * Pervasive environment, core environment, other "primitive" environments  * Pervasive environment, core environment, other "primitive" environments
403  -------------------------------------------------------------------------  -------------------------------------------------------------------------
404    
# Line 398  Line 433 
433  properly configured.  properly configured.
434    
435  Two libraries get pre-registered at bootstap time: the basis library  Two libraries get pre-registered at bootstap time: the basis library
436  ("basis.cm") and CM itself ("host-cm.cm").  The latter is crucial:  ("basis.cm") and CM itself ("minimal-cm.cm").  The latter is crucial:
437  without it one wouldn't be able to register any other libraries  without it one wouldn't be able to register any other libraries
438  via CM.autoload.  The registration of basis.cm is a mere convenience.  via CM.autoload.  The registration of basis.cm is a mere convenience.
439    
# Line 406  Line 441 
441  which can easily be made accessible via CM.autoload (or, non-lazily,  which can easily be made accessible via CM.autoload (or, non-lazily,
442  via CM.make):  via CM.make):
443    
444            full-cm.cm              - provides the actual ("full") structure CM
445                                      as described in the CM manual
446          host-compiler.cm        - provides "structure Compiler"          host-compiler.cm        - provides "structure Compiler"
447          host-cmb.cm             - provides "structure CMB"          host-cmb.cm             - provides "structure CMB"
448          target-compilers.cm     - provides "structure <Arch>Compiler" and          target-compilers.cm     - provides "structure <Arch>Compiler" and

Legend:
Removed from v.497  
changed lines
  Added in v.498

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