Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / basis-library / README
1 This directory contains the MLton implementation of the Basis Library.
2 The files are grouped in directories in the same way that the
3 corresponding modules are grouped in the basis library documentation.
4 All other implementation files are in the misc/ and libs/ directories.
5
6 The basis is constructed using the ML Basis system.
7
8 There are several special files that make use of non-SML extensions.
9
10 misc/primitive.sml
11 posix/primitve.sml
12 These are not Standard ML. They describe all of the primitives and
13 C routines used in the basis.
14
15 top-level/overloads.sml
16 Not Standard ML.
17 Uses the notation _overload <var> : <ty> as <var> (and <var>)*
18
19
20 Dead Code Elimination
21 ----------------------------------------
22 In order to compile small programs rapidly, a pass of dead code
23 elimination (core-ml/dead-code.{sig,fun}) is run in order to eliminate
24 as much of the basis library as possible. The dead code elimination
25 algorithm used is not safe in general, and only works because the
26 basis library implementation has special properties:
27 * it terminates
28 * it performs no I/O
29 The dead code elimination includes the minimal set of
30 declarations from the basis so that there are no free variables in the
31 user program (or basis). It has a special hack to include all
32 bindings of the form
33
34 val _ = ...
35