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/trunk/src/system/Init/init.cmi
ViewVC logotype

Annotation of /sml/trunk/src/system/Init/init.cmi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 416 - (view) (download)

1 : monnier 416 #
2 :     # spec.cmi
3 :     #
4 :     # (C) 1999 Lucent Technologies, Bell Laboratories
5 :     #
6 :     # Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
7 :     #
8 :     # This is the specification for how to build and set up a minimal set
9 :     # of "primitive" environments (including the pervasive environment,
10 :     # and the core environment).
11 :     #
12 :     # CM's normal group- and library processing cannot yet be used here
13 :     # because of certain peculiarities (non-modular top-level bindings to
14 :     # name the most important one).
15 :     #
16 :     # The specification is basically a DAG. The "bind" statements define
17 :     # named environments which are the results of compiling the files on the
18 :     # right-hand side of "=" wrt. a combination of the environments given
19 :     # in parentheses.
20 :     #
21 :     # Format of this file:
22 :     # - The file is processed on a line-by-line basis.
23 :     # - Empty lines and lines beginning with "#" are ignored.
24 :     # - Actual whitespace, "=", ",", "(", and ")" are all counted as whitespace.
25 :     # (this means that the syntactic sugar you see below is really just
26 :     # sugar for the human eye; the program that processes this file can
27 :     # do without it)
28 :     # - A line that says "nosplit" disables cross-module inlining (aka
29 :     # "lambda-splitting") until the next line that says "split".
30 :     # - "bind" specification that appear before the line that says "start"
31 :     # will not be listed in the boot list which is prepared for the
32 :     # runtime system boot loader. Thus, the only files that may appear
33 :     # before "start" must either contain pure signature and type bindings or
34 :     # be the placeholder for the runtime system itself.
35 :     # - "bind" lines must be in topological order (i.e., they cannot access
36 :     # environment names that are being defined later).
37 :     # - The last line that gets processed is the "return" line.
38 :     # It must specify at least three environment names in this order:
39 :     # * the one that is used as the system-wide "core" environment
40 :     # * the one that resulted from compiling the runtime system placeholder
41 :     # * the one that is used as the system-wide "pervasive" environment
42 :     # Any additional name is taken as the name of a "primitive" that
43 :     # can be accessed from within CM description files by the given name.
44 :     # (Access to such primitives is subject to CM's access control mechanism.)
45 :     # Note: If you need direct access to the core environment as a primitive,
46 :     # then you must list it twice (one time in its usual place, one time
47 :     # to establish it as a "primitive").
48 :     # - There is one pre-defined name ("primitive") that refers to the
49 :     # Environment.primEnv. It must not be "exported" by the "return" line.
50 :     #
51 :     # There is a side-condition on the core environment:
52 :     # CM will first compile just the minimal required number of files that is
53 :     # sufficient for getting hold of the core environment. Naturally, these
54 :     # files are compiled _without_ access to core and, therefore, cannot make
55 :     # use of any language feature that lets the compiler try and access the core.
56 :     # As soon as core is available, all remaining files are compiled using that
57 :     # core, though.
58 :    
59 :     # Turn off splitting. It would confuse the compiler because the following
60 :     # files are not actually loaded at boot time.
61 :     nosplit
62 :    
63 :     # The "signature" of the runtime system:
64 :     bind asig = assembly.sig (primitive)
65 :    
66 :     # The placeholder for the runtime system:
67 :     bind rts = dummy.sml (asig, primitive)
68 :    
69 :     # All other files must be loaded by the boot loader at boot time...
70 :     start
71 :    
72 :     # And we can turn the cross-module optimizer on (when available)...
73 :     split
74 :    
75 :     # This defines the core environment to be used everywhere else...
76 :     bind core = core.sml (rts, asig, primitive)
77 :    
78 :     # The rest of the DAG...
79 :     bind built-in = built-in.sml (core, primitive)
80 :     bind pp = pre-perv.sml (built-in)
81 :     bind ps = pre-string.sml (core, built-in, pp)
82 :     bind ss-sig = substring.sig (pp, built-in)
83 :     bind ss = substring.sml (ss-sig, pp, ps, core, built-in)
84 :     bind print-hook = print-hook.sml (built-in)
85 :     bind use-hook = use-hook.sml (built-in)
86 :     bind exn-info-hook = exn-info-hook.sml (built-in)
87 :     bind init-utils = init-utils.sml (ps ss-sig ss)
88 :    
89 :     # Building the "pervasive" environment. This file should be
90 :     # kept as small as possible and only bind non-modular things
91 :     # (i.e., top-level types and values).
92 :     bind pervasive = pervasive.sml (core, ps, ss, pp, print-hook, use-hook, exn-info-hook, built-in)
93 :    
94 :     # Report the results to the world...
95 :     return (core, rts, pervasive) built-in print-hook use-hook exn-info-hook core init-utils
96 :    

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