Possible things to do
---------------------

mael 2001-11-27: curry-compression: turn

    let f = \x.let g = \y.e1 in \z.e2
    in e3
    end

into

    let f = \x.\z.let g = \y.e1 in e2
    in e3
    end

Let C be the contexts defined by

    C[.] := .
          | let f = \x.e in C[.]
Turn
    let f = \x.C[\y.e1] in e2  
into
    let f = \x.\y.C[e1] in e2

mael 2001-11-13: turn curried functions into functions that take
  multiple arguments; build the closure at the call-site for those
  functions that are not fully applied:

    let f = \x1...\xn.e in (...(f e1)...en)  ==>
    let f = \<x1...xn>.e in f <e1,...,en>
      

mael 2001-11-12: better cross-module in-lining; support in-lining of
  non-closed functions.

mael 2001-11-12: don't built closures for top-level functions; all
  free variables of such functions are either (1) top-level functions,
  which by induction have no environment, or (2) top-level variables,
  which are statically allocated.

mael 2001-11-12: unboxed implementation of datatypes that
  have any number of nullary constructors but at-most three unary
  construtors that all take boxed arguments. With gc, only two unary
  constructors are allowed for the datatype to be implemented
  unboxed. Examples of datatypes that may be implemented unboxed
  include (1) The list datatype, (2) enumerations, (3) the Binary
  tree datatypes in kit/basislib/Binarymap.sml,
  kit/basislib/Binaryset.sml, kit/basislib/Intmap.sml,
  kit/basislib/Intset.sml, kit/basislib/Polyhash.sml,
  kit/basislib/Splaymap.sml, and kit/basislib/Splayset.sml, (4)
  Patricia trees (kit/src/Common/IntFinMapPT.sml), and (5) Union Find
  data structure (kit/src/Compiler/Kam/UnionFindPoly.sml.)
  
mael 2001-11-12: unboxed implementation of datatypes that
  have only one unary constructor; in most cases this optimisation is
  captured by the unboxing mentioned above.
 
mael 2001-08-07: improvment of pattern-matching; matching against a
  pair ((a,b),c) can be optimized by reusing part of the path to a for
  b.

mael 2001-08-07: catch stack-overflow

mael 2001-08-03: man pages for mlkit and smlserver, rp2ps

mael 2001-08-03: colors in rp2ps output

Unsolved bugs
-------------
nh 2001-06-01: ahref in Msp.sml is buggy

nh 2001-06-01: Fra url:
  http://www.it-c.dk/people/tofte/eksperiment1/index.html

    The results were (sorted by decreasing speed):

    1.4,393 secs: compiler: ML Kit; target code: no garbage collection (i.e., only regions) 
    2.4,802 secs: compiler: ML Kit; target code: regions and garbage collection 
    3.6,3 secs: compiler: mosml; target code: garbage collection, no regions 
    4.8,131 secs: compiler: ML Kit; target code: regions, garbage collection and profiling.
       Check the region profile graph and the object profil of the largest region. (The program
       points in the latter graph do not seem to be right: maybe the same program points are
       used in the basis library and in the evaluation system code?.) 


                             VERSION 3


ERROR:
SYMPTOM:
TESTFILE:
PRIORITY: (HIGH|MEDIUM|LOW)
REPORTED BY: (MT|ME|FAXE) + date
TO BE FIXED BY: (MT|ME|FAXE)

=============================== BUGS ===============================
ERROR: CompileDec `val rec pat' error
SYMPTOM: Compilation crashes: 
           Impossible: CompileDec.compileREC.id_sigma
TESTFILE: kit/test/valrecpat.sml
PRIORITY: MEDIUM
REPORTED BY: ME 1999-04-12
TO BE FIXED BY: ME
--------------------------------------------------------------------
ERROR: ElabDec `val rec pat' error
SYMPTOM: Elaboration fails to succeed (see The Def. page 24)
TESTFILE: test/valrecpat2.sml
PRIORITY: MEDIUM
REPORTED BY: ME 1999-04-12
TO BE FIXED BY: ME
=============================== WAIT ===============================

Large elaboration bases are annotated on the ast (functor bindings)
during elaboration. Such annotated bases cause opacity elimination to
be slow when compiling large programs; opacity elimination applies
realisations to ast annotated objects. To improve speed of
compilation, we should restrict the annotated bases to those
identifiers that occur free in the functor binding. Is it possible to
do this restriction during the pass for finding free identifiers
(FreeIds)?
 
Implement some kind of project reuse; it currently takes too long for
the manager to find out that the code for the basis library can be
reused. The problem is that the result basis for the basis library
project is reconstructed, from the result bases for the individual
sources of the library, every time the project is reused.

Variables that occur free in a program unit are associated with
labelled slots in the data segment of the final executable; thus,
these variables need not be stored in closures. It suffices to fetch
them from the data segment.

Currently, we do not treat multiple declarations of the same functor
identifier in the same project. We can allow this; but we cannot allow
a functor identifier to be declared more than once in a source file.

Allow in-lining of functors and pre-processing through
ML-Yacc and ML-Lex. Syntax:

     bdy ::= inline funidseq                     functor inlining
          |  local bdy in bdy end                local
	  |  bdy bdy |  _                        sequential
          |  file.sml | file.sig                 source file
          |  file.o                              precompiled object
          |  file.grm                            yacc source file
          |  file.lex                            lex source file

Declare polymorphic eq. in the initial basis, and make it impossible
to redeclare equality; if equality is in the initial basis then
in-lining happens automatically.

How are we going to model the differences between the specification of
the Math structure and the semantics of /usr/include/math.h? For now,
I think that we should just do whatever math.h does; MosML does not
implement NaN, posInf, and negInf; instead, MosML raises Overflow when
the specification suggests to return NaN, posInf, or negInf.

Implementation of Real.round on systems that do not have rint() (i.e.,
systems based on gcc's library). Real.round is broken in MosML, so we
cannot copy the code.

Why are regions that are passed to primitive functions in the runtime
system not tested for resetting automatically (in CompLamb);
currently, the user must do the resetting in the C function. Is there
a reason? What about Mogensens idea about resetting?

============================= DONE ================================

ERROR:
SYMPTOM:
TESTFILE: (file in TestEnv, added to acceptance test)
PRIORITY: (HIGH|MEDIUM|LOW)
REPORTED BY: (MT|ME|FAXE) + date
TO BE FIXED BY: (MT|ME|FAXE)
FIXED BY: (MT|ME|FAXE) + date

-------------------------------------------------------------------

[(ME 1998-08-21): Eliminate generated object code that is never used
by applying a backward use-analysis. We cannot eliminate object code
for units with side-effects, however.]

-------------------------------------------------------------------

[(ME 1998-08-21): Delete the TestEnv/Output_X_on_Y directories and
replace them by one directory expected_output. The output from running
the tests should be the same on different machines. Moreover, the
output should be the same even if profiling is enabled (profiling
messages should be directed to stdErr).]

-------------------------------------------------------------------

[(ME 1998-09-26): Remove the problematic value space (valspace). It
seems that kam variables are local to each target unit; currently,
however, we allocate a global store (in data space) for these
variables and this store grows, infinitely, when the project is
recompiled. Instead, we can associate spilled registers to local slots
in each compilation unit.]

-------------------------------------------------------------------

ERROR: reelaboration of functor fails for overloading
SYMPTOM: 
	  Impossible: StatObject.instance'.fresh
	  Error while reconstructing functor body for Util
	  *** CRASH raised *

TESTFILE: ~mael/kit_projects/modules/util.sml
PRIORITY: HIGH
REPORTED BY: ME 1998-10-08
TO BE FIXED BY: ME
FIXED BY: ME and MT
COMMENT: realisations were not meant to be applied to type schemes for
overloaded functions. However, Elsmans implementation of opacity
elimination applies realisations to bases annotated in the ast
during elaboration.

-------------------------------------------------------------------

ERROR: basis restriction crashes compilation
SYMPTOM: 
  [compiling body of functor F (from project interp.pm) begin]
  problems with tyname environment
  tyname: t
  is not in the domain of the environment:
  ...
TESTFILE: ~mael/kit_projects/modules/interp.pm
PRIORITY: HIGH
REPORTED BY: ME 1998-10-12
TO BE FIXED BY: ME
FIXED BY: ME 1998-10-12
COMMENT: When restricting an interpretation basis, then associations
for tynames that occur free in the restricted interpretation functor
environment must be kept (ManagerObjects.IntBasis.restr).

-------------------------------------------------------------------

ERROR: bdy truncation
SYMPTOM: compilation crashes because .bdy file for 
functor is truncated:

                   structure F : sig end

TESTFILE: ~mael/kit_projects/modules/bdy_truncate.sml
PRIORITY: HIGH
REPORTED BY: ME 1998-10-12
TO BE FIXED BY: ME
FIXED BY: ME 1998-10-12
COMMENT: The position info annotated on the body of functor
bindings were wrong! I inserted a LETstrexp around the
body, so that the info on sigexp constraints did not have
to be altered (which would make error-reporting disastrous).

-------------------------------------------------------------------

ERROR: pattern match incorrect redundancy
SYMPTOM: The Kit reports that the second rule of the program

  fun f {a=1, b} = 1
    | f {b=1, a} = 2
    | f _ = 3

is redundant and generates incorrect code for the function.

TESTFILE: ~mael/kit_projects/modules/patterns.sml
PRIORITY: HIGH
REPORTED BY: ME 1998-10-13
TO BE FIXED BY: ME
FIXED BY: ME 1998-10-21
COMMENT: There was a problem with the ordering of record elements in 
patterns (file CompileDec.sml).

--------------------------------------------------------------------

[(ME 1998-10-21): Allow `local' source files in projects.  DONE]

--------------------------------------------------------------------

[(ME 1998-11-17): String.toString(s) does not surround s with
quotation marks, as String.string from the Edinburgh Library does. So,
we need to surround strings with quotation marks in prettyprinting,
and so on.  DONE]

--------------------------------------------------------------------

ERROR: ElabDec datatype error
SYMPTOM: Compilation crashes: 
           Impossible: Environments.ExplicitTyVar_lookup 
TESTFILE: kit/test/freedatatype.sml
PRIORITY: MEDIUM
REPORTED BY: ME 1999-05-05
TO BE FIXED BY: ME
FIXED BY: ME 2001-03-10
COMMENT: See the file kit/test/freedatatype.sml for comments.
--------------------------------------------------------------------
