===============================
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
lingay.sh 2009-04-10 13:10 65 lingay.cm 2009-04-10 13:10 544 lingay-old.cm 2009-04-10 13:10 521 examples/ 2009-04-10 13:10 - Types.sml 2009-04-10 13:10 18K Typechecker.sml 2009-04-10 13:10 51K Thread.sml 2009-04-10 13:10 22K Semantics.sml 2009-04-10 13:10 13K SMLNJ-old.sml 2009-04-10 13:10 66 SMLNJ-new.sml 2009-04-10 13:10 105 RunExp.sml 2009-04-10 13:10 10K Pervasives.sml 2009-04-10 13:10 3.9K Parser.grm 2009-04-10 13:10 12K Makefile 2009-04-10 13:10 56 Lingay.sml 2009-04-10 13:10 9.5K Lexer.lex.sml 2009-04-10 13:10 211K Lexer.lex 2009-04-10 13:10 4.1K Exec.sml 2009-04-10 13:10 261 Control.sml 2009-04-10 13:10 9.3K CBV_Games.sml 2009-04-10 13:10 9.3K CBN_Games.sml 2009-04-10 13:10 22K BuildRuntime.sml 2009-04-10 13:10 858 Absyn.sml 2009-04-10 13:10 22K