## MLton 20241230

# CompilationManager

The Compilation Manager (CM) is SML/NJ’s mechanism for supporting programming-in-the-very-large.

## Porting SML/NJ CM files to MLton

To help in porting CM files to MLton, the MLton source distribution includes the sources for a utility, `cm2mlb`, that will print an ML Basis file with essentially the same semantics as the CM file — handling the full syntax of CM supported by your installed SML/NJ version and correctly handling export filters. When `cm2mlb` encounters a `.cm` import, it attempts to convert it to a corresponding `.mlb` import. CM anchored paths are translated to paths according to a default configuration file (`cm2mlb-map`). For example, the default configuration includes

    # Standard ML Basis Library
    $SMLNJ-BASIS                            $(SML_LIB)/basis
    $basis.cm                               $(SML_LIB)/basis
    $basis.cm/basis.cm                      $(SML_LIB)/basis/basis.mlb

to ensure that a `$/basis.cm` import is translated to a `$(SML_LIB)/basis/basis.mlb` import. See `util/cm2mlb` for details. Building `cm2mlb` requires that you have already installed a recent version of SML/NJ.