Lingay prototype implementation

John Longley and Nicholas Wolverson, Feb-Aug 2008.

THIS VERSION April 2009.

This README accompanies a prototype implementation of Lingay written in
Standard ML of New Jersey. To run the code, you will need SML/NJ: code
has been tested with the old stable version (110.0.7, installed in
.inf.ed.ac.uk) and current working version (110.67, current as of Nov
2007). The code makes some minor use of SML/NJ specific libraries, but
is mostly tied to SML/NJ via the use of the included ML-Lex and ML-Yacc.

[ Shortcut: make && ./lingay.sh [f] - 
  compile typechecker, create SML/NJ heap image, 
  run typechecker on file f if argument present,
  otherwise start interactive session ]

Running the code: start the sml runtime in this directory (tip: I use
rlwrap to enable readline support). The next step is version-dependant:

stable:		CM.make' "lingay-old.cm"
working:	CM.make  "lingay.cm"

The top level environment now contains two structures, Absyn
(representation of ASTs and some related machinery), and Lingay (main
implementation). There are two main functions you will be interested in:

Lingay.start ()		- enter interactive read/eval loop 
                          (the normal way to invoke Lingay)
Lingay.loadFile f      -  load the Lingay declarations in file f, then
                          enter interactive mode

Other functions (less often needed in normal use):

Lingay.startRet ()	- as start, but return environment after 
                          quitting the interactive session
Lingay.parseFile f	- parse and typecheck file f
Lingay.parseFileRet f	- as above, returning the resulting environment

(On at least some installations, typing Ctrl-C Ctrl-C RETURN gets you
out of the interactive Lingay session and returns you to the ML prompt.
Typing Ctrl-D quits the ML session.)

Missing features

1. The runtime machinery for linear class extension and instantiation 
   is not yet implemented (they are recognized by the typechecker).
2. The reftype system (characterized by the keywords reftype, ref, deref)
   isn't yet implemented, either in the typechecker or the runtime system.
3. A few derived syntactic forms (in particular sugared class expressions)
   aren't yet supported.

Known bugs
Multiline comments cause error reports to have incorrect (low) line number 
(* e.g., this one
will cause line numbers to be 1 short *)
(* but these two  *)
(* are both fine  *)
      Name                    Last modified      Size  Description
Absyn.sml 2009-04-10 13:10 22K BuildRuntime.sml 2009-04-10 13:10 858 CBN_Games.sml 2009-04-10 13:10 22K CBV_Games.sml 2009-04-10 13:10 9.3K Control.sml 2009-04-10 13:10 9.3K Exec.sml 2009-04-10 13:10 261 Lexer.lex 2009-04-10 13:10 4.1K Lexer.lex.sml 2009-04-10 13:10 211K Lingay.sml 2009-04-10 13:10 9.5K Makefile 2009-04-10 13:10 56 Parser.grm 2009-04-10 13:10 12K Pervasives.sml 2009-04-10 13:10 3.9K RunExp.sml 2009-04-10 13:10 10K SMLNJ-new.sml 2009-04-10 13:10 105 SMLNJ-old.sml 2009-04-10 13:10 66 Semantics.sml 2009-04-10 13:10 13K Thread.sml 2009-04-10 13:10 22K Typechecker.sml 2009-04-10 13:10 51K Types.sml 2009-04-10 13:10 18K examples/ 2009-04-10 13:10 - lingay-old.cm 2009-04-10 13:10 521 lingay.cm 2009-04-10 13:10 544 lingay.sh 2009-04-10 13:10 65