Subject: Comp.Lang.ML FAQ [Monthly Posting]
Date: 2 Apr 1996 16:30:42 GMT
Summary: This posting contains a list of Frequently asked questions (and their
         answers) about the family of ML programming languages, including 
         Standard ML, CAML, Lazy-ML, and CAML-Light.  This post should be read 
         before asking a question on the comp.lang.ml newsgroup.



         COMP.LANG.ML Frequently Asked Questions and Answers 
.   (compiled by Dave Berry and Greg Morrisett)
           (maintained by Rowan Davies) 

Please send corrections, additions, or comments regarding this list to
comp-lang-ml-request@cs.cmu.edu.  

Changes since last month:

- Updated email address for Joern Erbguth.
- Added Amiga port of Edinburgh ML.

Contents:
---------
.1. What is ML?
.2. Where is ML discussed?
..a. Comp.Lang.ML
..b. SML-LIST
..c. CAML-LIST
.3. What implementations of ML are available?
..a. quick summary (by machine/OS)
 ..b. Standard ML of New Jersey (SML/NJ)
..c. sml2c
..d. Caml Light
                e. Bigloo
..f. Moscow ML
..g. ML Kit
                h. Edinburgh
..i. MicroML
..j. Poly/ML
..k. Poplog ML
        4. Unsupported SML/NJ Ports
..a. Linux
..b. OS/2
                c. FreeBSD
..d. NEXTSTEP
 ..e. SVR4
        5. Where can I find documentation/information on ML?
..a. The Definition
..b. Textbooks
..c. Info on the net
.6. Where can I find ML library code?
..a. The Edinburgh SML Library
..b. The SML/NJ Library
                c. Caml-light libraries
..d. The Qwertz Toolbox (for AI)
.7. Theorem Provers and ML
        8. Miscellaneous Questions
..a. How do I write the Y combinator in SML?
..b. Where can I find an X-windows interface to SML?
..c. How do I call a C function from SML/NJ?
..d. How do I fix the emacs mode to work with emacs 19?

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

0. Where can I find the latest copy of this FAQ?

  This document can be retrieved via anonymous ftp from
    ftp://pop.cs.cmu.edu/usr/rowan/sml-archive/faq.txt
  or from rtfm.mit.edu.  There is an HTTP version with active links at
    http://www.cis.ohio-state.edu/hypertext/faq/usenet/meta-lang-faq/faq.html

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

1. What is ML?

  ML (which stands for Meta-Language) is a family of advanced programming 
  languages with [usually] functional control structures, strict semantics, 
  a strict polymorphic type system, and parametrized modules.  It includes 
  Standard ML, Lazy ML, CAML, CAML Light, and various research languages.  
  Implementations are available on many platforms, including PCs, mainframes,
  most models of workstation, multi-processors and supercomputers.  ML has 
  many thousands of users, is taught at many universities (and is the first
  programming language taught at some).

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

2. Where is ML discussed?

COMP.LANG.ML
------------
comp.lang.ml is a moderated usenet newsgroup.  The topics for discussion
include but are not limited to:

   * general ML enquiries or discussion 
   * general interpretation of the definition of Standard ML 
   * applications and use of ML 
   * announcements of general interest (e.g. compiler releases)
   * discussion of semantics including sematics of extensions based on ML
   * discussion about library structure and content
   * tool development
   * comparison/contrast with other languages
   * implementation issues, techniques and algorithms including extensions
     based on ML

Requests should be sent to:

.comp-lang-ml@cs.cmu.edu

Administrative mail should be sent to:

.comp-lang-ml-request@cs.cmu.edu

Messages sent to the newsgroup are archived at CMU.  The archives can be
retrieved by anonymous ftp from internet sites.  Messages are archived
on a year-to-year basis.  Previous years' messages are compressed using
the Unix "compress" command.  The current year's messages are not
compressed.

.ftp pop.cs.cmu.edu
.username: anonymous
.password: <username>@<site>
.binary
.cd /usr/rowan/sml-archive
.get sml-archive.<year>.Z
.quit
.zcat sml-archive.<year>.Z

(Pop's IP address is 128.2.205.205).

Individual messages can also be accessed in the directories
/usr/rowan/mh-sml-archive/<year>-sml.

SML-LIST
--------
The SML-LIST is a mailing list that exists for people who cannot
(or do not want to) read the Usenet COMP.LANG.ML newsgroup. 
Messages are crossposted from COMP.LANG.ML to the SML-LIST and
vice-versa.  You should ask to join the SML-LIST _only if_ you cannot
(or do not want to) read the Usenet COMP.LANG.ML newsgroup.

To send a message to the SML-LIST distribution, address it to:

.sml-list@cs.cmu.edu

(sites not connected to the Internet may need additional routing.)

Administrative mail such as requests to add or remove names from the
distribution list should be addressed to 

.sml-list-request@cs.cmu.edu


CAML-LIST
---------
The Caml language, a dialect of ML, is discussed on the Caml mailing
list.  To send mail to the Caml mailing list, address it to:

.caml-list@margaux.inria.fr

Administrative mail should be addressed to:

.caml-list-request@margaux.inria.fr

ALT.LANG.ML
-----------
No longer used.

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

3. What implementations of ML are available and where can I find them?


Quick Summary:

System.full SML?  contact.  ..          Platforms
------.---------  ------------..         ------------------------------
SML/NJ.   yes     sml-nj@research.att.com       Unix/Sparc,Mips,Vax,680x0,
 ..   ftp.research.att.com          I386/486/Pentium,HPPA,RS/6000,
...... MacOS/MacII
 ..   ftp.cs.sunysb.edu.         Linux (including binaries)
..   ftp-os2.nmsu.edu.. OS/2  (including binaries)
..   ftp.informatik.uni-muenchen.de  Nextstep

sml2c.   yes.   dtarditi@cs.cmu.edu.. 32-bit Unix machines (C code)
..   ftp.cs.cmu.edu

Caml Light coreish caml-light@margaux.inria.fr. Unix, Mac, PC 80386,
..   ftp ftp.inria.fr.. (bytecode)

Caml Specl   own   caml-light@margaux.inria.fr. Unix (Alpha, Sparc, 
 Light     modules ftp ftp.inria.fr..       486/Pentium, Mips)

Bigloo     coreish Manuel.Serrano@inria.fr.      Unix (compiles caml-light 
                   ftp ftp.inria.fr                    to native code)

Moscow ML  core+   sestoft@dina.kvl.dk.. PC 80386, Mac, Unix 
..   ftp ftp.dina.kvl.dk           (bytecode)

Kit.   yes.   ftp ftp.diku.dk.. (Requires another SML compiler
..   ftp ftp.dcs.ed.ac.uk..  to build binaries)

Edinburgh  core.   ftp ftp.dcs.ed.ac.uk.         32-bit machines (bytecode)
..   ftp ftp.informatik.uni-muenchen.de    PC 80386SX+, Amiga

MicroML    core    Olof.Johansson@cs.umu.se      PC 8086+ (bytecode)
..   ftp ftp.cs.umu.se

Poly/ML.   yes.   ahl@ahl.co.uk   .         SPARC/SUNOS, SPARC/Solaris
                                                 RS6000/AIX

PoplogML   yes     isl@isl.co.uk               Sun/Solaris, Sun/SunOS, SG/IRIX,
                                               PC/Linux, HP/HP-UX, Alpha/OSF,
                                               Alpha/VMS, VAX/VMS


Details:

Standard ML of New Jersey
-------------------------
(Sometime later this year the SML/NJ team expects to release a new general 
public release of Standard ML of New Jersey, the first such release since 
version 0.93 in the spring of 1993.  See the paragraph at the end of this
subsection for a preview of this new version.)

Standard ML of New Jersey was developed jointly at AT&T Bell
Laboratories and Princeton University.  It is an open system (source
code is freely available) implemented in Standard ML.  Version 0.93 of
SML/NJ generates native code for 68020, SPARC, and MIPS (big and
little endian), I386/486/Pentium, HPPA(HP9000/700), and RS/6000
architectures under various versions of the Unix operating system
(SunOS, Ultrix, Mach, Irix, Riscos, HPUX, AIX, AUX, etc.), and on the
Macintosh OS (Mac II, System 7.x, min 12MB ram or any system of
greater or equal power, which includes most Macs produced after about
1987).  Version 0.75 runs on the Vax under Ultrix, BSD, and Mach.

There are unsupported ports of SML/NJ to other platforms, including
Linux, FreeBSD, NEXTSTEP, OS/2, and SVR4.  See the "Unsupported SML/NJ
Ports" section for details.

SML/NJ comes with a source-level debugger, profiler, gnu emacs
interface, ML implementations of LEX, YACC, and Twig, separate
compilation facilities, Concurrent ML, the eXene X Window library, and
the SML/NJ library.  It runs interactively and can produce stand-alone
executable applications.

Non-standard extensions include typed first-class continuations, Unix
signal handling, and higher-order functors.

SML/NJ is copyrighted by AT&T but the system, including source code,
is freely distributable.  It is available by anonymous ftp from
ftp.research.att.com (192.20.225.2) and princeton.edu (128.112.128.1).
Login as "anonymous" with your user name as password.  Put ftp in
binary mode and copy the (compressed tar) files you need from the
directory dist/ml (pub/ml on princeton.edu).  You only need the
93.mo.*.tar.Z files for your machine in addition to the 93.src.tar.Z.
(You might also want the 93.release-notes.[ps|txt], 93.tools.tar.Z,
93.doc.tar.Z, and smlnj-lib-0.2.tar.Z files.)  Alternatively mail
sml-nj@research.att.com.  In the UK, SML/NJ is available from the
LFCS.

The upcoming general public release of SML/NJ (the successor to
version 0.93) will include the following improvements:

.- Vastly improved standard library, operating system interface
.- SML Standard Library compliant
.- Excellent support for separate compilation
.- Improved execution speed
.- New, high-tech garbage collector
.- Portable runtime system
.- Character type distinct from single-character strings
.- Easier interface to C code
.- Many platforms supported:
    .      Intel 80x86:  Linux, FreeBSD, [Win NT, Win '95, OS/2, NeXTStep], 
              SGI (MIPS): Irix 5.x, Irix 4.x
              HP Precision:  [HPUX 10, NeXTStep]
              DEC Alpha:  OSF/1
              Sparc:  SunOS, Solaris
              RS/6000, PowerPC:  AIX, [MacOS]
              68020:  SunOS, [MacOS, NeXTStep]

For those brave souls who want the latest, interim version, we are pleased
to announce the availability of an interim SML/NJ version, 
by anonymous FTP from ftp.research.att.com:dist/ml/working.  
Integer release numbers (currently 108) are generally more stable than
the intermediate fractional releases (i.e., versions 108.x); 
both are located in the dist/ml/working directory. 
Get the 108-README file (by FTP) for more information.
We DO NOT RECOMMEND this version for anyone who is happy with version 0.93; 
these users should wait until the next general release, later this
year.  But those who need a newer version because it supports their
computing platform, or because they need some recently implemented
feature, or who want to make performance measurements, may wish to
obtain version 108.  THIS VERSION IS ILL-DOCUMENTED and STILL NEEDS
IMPROVEMENT.  However, if you are now using any version between 0.94
and 1.07 we STRONGLY RECOMMEND that you switch to 108, which is more
stable and up-to-date.

Note: [Bracketed] architectures listed above will be supported in the 
general release but are not yet available in the interim versions found 
in the 'dist/ml/working' directory.

There is a WWW page for SML/NJ, including a collection of projects
implemented in ML:
  http://www.cs.Princeton.EDU:80/faculty/appel/smlnj/


SML2C
-----
sml2c is a Standard ML to C compiler.  It is based on an old
version of SML/NJ from 1992 and shares its front-end and most of the
runtime system. sml2c is a batch compiler and compiles only module-level
declarations.  It does not support SML/NJ style debugging and profiling.

sml2c is easily portable and has been ported to IBM RT, 
Decstation 3100, Decstation 5000, Omron Luna 88k, sun-3, sun-4 and a 
486-based machine (running Mach).  The generated code is highly portable 
and makes very few assumptions about the target machine or the C compilers 
available on the target machine. The runtime system, which it shares with 
the SML/NJ has several machine and operating system dependencies.  sml2c 
has eliminated some of these dependencies by using portable schemes for 
garbage collection and for freezing and restarting programs.

sml2c is available by anonymous ftp from ftp.cs.cmu.edu
(128.2.206.173). Log in as anonymous, send username@node as password.
The distribution can be found in /afs/cs/project/mess/research/sml2c/ftp.
The local ftp software will allow you to change directory only
to /afs/cs/project/mess/research/sml2c/ftp.  The README file in this
directory describes the files in the distribution.
The size of the uncompressed distribution is about 12 Meg.


CAML LIGHT
----------
Caml Light is a portable, bytecode interpreter for CAML, a dialect of ML.
Some features of Caml Light include separate compilation, streams and
stream parsers, ability to link to C code, and a fairly rich library.
The implementation has low memory requirements, compiles quickly and
generates compact executables. 

The Caml Light system comprises a batch compiler, a toplevel-based
interactive compiler, tools for building libraries and toplevel
systems, a replay debugger, and a hypertext-based module browser.

Caml Light runs on most modern Unix machines, including Sun
Sparcstations (under SunOS 4.1 and Solaris 2), Decstations 3000
(Alpha) and 5000 (Mips), and PCs under Linux, but many more machines
have been reported to work. It is also available for the Macintosh (as
a "fat binary" that runs native on PowerMacs) and the 386 PC under
MSDOS/MSWindows.

The current version is 0.7, released in July 1995. It is available by
anonymous ftp from:

    host:           ftp.inria.fr    (192.93.2.54)
    directory:      lang/caml-light

Summary of the files:

    README              More detailed summary
    cl7unix.tar.gz      Unix version (source code)
    cl7macbin.sea.hqx   Binaries for the Macintosh version
    cl7macsrc.sea.hqx   Source code for the Macintosh version
    cl7pcbin.zip        Binaries for the 80386 PC version
    cl7pcsrc.zip        Source code for the 80386 PC version
    cl7lin*.tar.gz      Binaries for Linux
    cl7refman.*         Reference manual, in various formats
    cl7tutorial.*       Tutorial, in various formats

This release fixes all known bugs from release 0.61 and has many new
features, libraries and contributed tools, including a source-level
replay debugger and a Tk-based graphical user interface, with
application to a flashy browser for module interfaces.

More info on Caml Light is available on the Web, at
http://pauillac.inria.fr/caml

The implementors can be contacted at caml-light@pauillac.inria.fr.
General questions and comments of interest to the Caml community
should be sent to caml-list@margaux.inria.fr, the Caml mailing
list. (see question 2 above for details.)


CAML SPECIAL LIGHT
------------------
Caml Special Light is a complete reimplementation of Caml Light that
adds a powerful module system in the style of Standard ML. The module
system is based on the notion of manifest types / translucent sums; it
supports Modula-style separate compilation, and fully transparent
higher-order functors.

Caml Special Light comprises two compilers: a bytecode compiler in the
style of Caml Light (but up to twice as fast), and a high-performance
native code compiler for the following platforms:

        Alpha processors: DecStation 3000 under OSF1
        Sparc processors: Sun Sparcstation under SunOS 4.1 or Solaris 2
        Intel 486 / Pentium processors: PCs under Linux, FreeBSD, NextStep
        Mips processors: DecStation 3100 and 5000 under Ultrix 4

The native-code compiler delivers excellent performance (better than
Standard ML of New Jersey 1.08 on our tests), while retaining the
moderate memory requirements of the bytecode compiler.

Caml Special Light is still in the development phase and less stable
than Caml Light: the base language has changed and will change again
in significant ways, and not all Caml Light libraries and development
tools have been ported to Caml Special Light.

The source distribution (for Unix machines only) is available by
anonymous FTP on ftp.inria.fr, directory lang/caml-light.

More information on Caml Special Light is available on the World Wide
Web, at http://pauillac.inria.fr/csl/.

Bug reports and technical questions should be directed to
caml-light@pauillac.inria.fr. For general questions and comments,
use the Caml mailing list caml-list@pauillac.inria.fr (to subscribe:
caml-list-request@pauillac.inria.fr).


BIGLOO
------
Bigloo is an optimizing Scheme-to-C and Caml-to-C compiler that
produces native machine code from Caml sources. Compatibility with the
bytecoded implementation of Caml Light is almost perfect. Performance
of generated code is on a par with that of New Jersey ML. Bigloo is
also one of the most efficient Scheme compilers available.

Bigloo runs on the following Unix platforms: Decstations 3000 and
5000, Sparcstations, PCs under Linux, HP PA 730 and Sony News R3000.

Bigloo is being developed by Manuel Serrano (Manuel.Serrano@inria.fr).

Available by anonymous FTP from ftp.inria.fr, file 
lang/caml-light/bcl*.tar.gz.


MOSCOW ML
---------
Moscow ML is a Core Standard ML implementation, based on the Caml Light 
system.  It compiles fast and uses little memory, yet the generated 
bytecode is only 3 to 8 times slower than SML/NJ compiled code.

Moscow ML implements the SML Core language and separate compilation
via a limited version of the SML Modules language, with signatures and
non-nested structures but no functors.

The new version 1.30 implements parts of the new SML Standard Library
(but not yet the new I/O library); can produce compact stand-alone
executables (a la Caml Light); has been rewritten in SML and is now
easier to install; and supports quotations and antiquotations, useful
for metaprogramming.

Under DOS, Moscow ML requires a 386 or 486 or 586 PC with 2 MB of RAM
or more, and DOS 3.3 or later.  It can be compiled on any platform
supported by Caml Light, except that we don't know that anybody has
compiled it on a Mac.  So far we have tried Intel386-based PCs running
DOS, Windows, OS/2 or Linux, DEC MIPS+Ultrix, DEC Alpha+OSF/1,
Sun4+SunOS, Sun+Solaris, SGI MIPS+IRIX, and HP9000+HP/UX.

Moscow ML was written by Sergei Romanenko (sergei-romanenko@refal.msk.su) 
at the Keldysh Institute of Applied Mathematics, Moscow, Russia, and
Peter Sestoft (sestoft@dina.kvl.dk) at the Royal Veterinary and 
Agricultural University, Denmark.

    * The Moscow ML home page is at
.http://www.dina.kvl.dk/~sestoft/mosml.html
    * The DOS executables (and documentation) are in
        ftp://ftp.dina.kvl.dk/pub/mosml/mos13bin.zip
    * The Linux executables (and documentation) are in
        ftp://ftp.dina.kvl.dk/pub/mosml/linux-mos13bin.tar.gz
    * The DOS source files (no documentation) are in
        ftp://ftp.dina.kvl.dk/pub/mosml/mos13src.zip
    * The Unix source files (no documentation) are in
        ftp://ftp.dina.kvl.dk/pub/mosml/mos13src.tar.gz
    * The Macintosh binaries (for PowerPC and 68k) are in
        ftp://ftp.dina.kvl.dk/pub/mosml/mac-mos13bin.sea.hqx
    * The Macintosh sources (those different to Unix) are in
.ftp://ftp.dina.kvl.dk/pub/mosml/mac-mos13src.sea.hqx

The Internet number of ftp.dina.kvl.dk is 130.225.40.226.

The files are mirrored at ftp://ftp.dcs.ed.ac.uk/pub/ml/Moscow


ML Kit
------
The ML Kit is a straight translation of the Definition of Standard
ML into a collection of Standard ML modules.  For example, every
inference rule in the Definition is translated into a small piece of
Standard ML code which implements it. The translation has been done
with as little originality as possible - even variable conventions
from the Definition are carried straight over to the Kit.

If you are primarily interested in executing Standard ML programs
efficiently, the ML Kit is not the system for you! (It uses a lot of
space and is very slow.) The Kit is intended as a tool box for those
people in the programming language community who may want a
self-contained parser or type checker for full Standard ML but do not
want to understand the clever bits of a high-performance compiler. We
have tried to write simple code and module interfaces; we have not
paid any attention to efficiency.

The documentation is around 100 pages long and is provided with the
Kit. It explains how to build, run, read and modify the Kit. It also
describes how typing of flexible records and overloading are handled
in the Kit.

The ML Kit is written by Nick Rothwell, David N. Turner, Mads Tofte
and Lars Birkedal at Edinburgh and Copenhagen Universities.

There is a WWW page for the ML Kit at:
     http://www.diku.dk/research-groups/topps/activities/mlkit.html
   
The ML Kit is also available via anonymous ftp. Here is a sample
dialog:

  ftp ftp.diku.dk  ...ftp ftp.dcs.ed.ac.uk
  Name: anonymous..  .Name: anonymous
  Password: <your loginname@host>  .Password: <your loginname@host>
  ftp> binary  ....ftp> binary
  ftp> cd diku/users/birkedal  ..ftp> cd export/ml/mlkit
  ftp> get README  ...ftp> get README
  ftp> get COPYING  ...ftp> get COPYING
  ftp> get src.tar.Z  ...ftp> get src.tar.Z
  ftp> get doc.tar.Z  ...ftp> get doc.tar.Z
  ftp> get tools.tar.Z  ..ftp> get tools.tar.Z
  ftp> get examples.tar.Z  ..ftp> get examples.tar.Z
  ftp> bye  ....ftp> bye

The file README contains installation instructions. Note that no
binaries are distributed and that you must build these using either
Standard ML of New Jersey, or Poly/ML.


Edinburgh ML 4.0
----------------
Edinburgh ML 4.0 is an implementation of the core language (without
the module system).  It uses a bytecode interpreter, which is written in C
and runs on any machine with 32 bit words, a continuous address space and
a correct C compiler.  Ports to various 16 bit machines are underway.  The
bytecode interpreter can be compiled with switches to avoid the buggy parts
of the C compilers that we've used it with (as far as I know none of them
worked correctly).  

Edinburgh ML 4.0 is available from the LFCS.  See the WWW link:
     http://www.dcs.ed.ac.uk/lfcsinfo/index.html

A port to PCs with 386SX processors or better is available by FTP from
ftp.informatik.uni-muenchen.de, in the file
pub/comp/programming/languages/sml/ibmpc/edml3864.exe.
Contact Joern Erbguth (erbguth@juris-sb.de) for more information.

Also, there are apparently 8086 and 80386-specific ports of Edinburgh
ML 3.5 in the same location.  The 386 port is in the file
edml3863.exe.

There are other Edinburgh (PC-)ports of ML including an OS/2 2.x, an
OS/2 PM and a Dos version. A new version has just been made ready and
is available at forwiss.uni-passau.de (132.231.1.10) in
pub/ibmpc/os2/lang/sml/sml04.zip. It is about 360K long (short?).

.All 3 programs have in common (all in one .zip):
.   - true 32 Bit applications
.   - easy to install, easy to use
.   - As far as I know they work stable
.     (except the DOS version working as a Windows window
.     [you can use it with Windows but it crashes on *exit*])
.   - they don't require expensive hardware 
.     (and they don't need a co-processor)

.To be more specific:
.      OS/2 PM               OS/2                DOS.
.OS    >= OS/2 2.0+ServPak   >= OS/2 2.0..>= DOS 5.0
.Edit  PM, GUI,              Standard            command history
.      integrated editor
.      (cut&paste)
.HW    >= 386/33, 8MB        >= 386/33 4MB       >= 386sx, 2MB
.      lots of MB and fast
.      graphics ad. recommended
.Help  online                online
.      (+ML ref. in german)

There's also an amiga port of Edinburgh ML available on all aminet ftp
sites (amiga users should know which these are) in dev/lang, called
"sml4.1.02.lha".  The standard version needs a 68020 or better and an
FPU but there is a 68000-only version as well.

MicroML
-------
MicroML is an interpreter for core SML that runs on IBM PCs,
from the Department of Computing Science at the Umea University in
Sweden.  It implements the core language except for records.  A 80286
processor or better is recommended, but it runs even on a 8086. 

MicroML is available by anonymous ftp from
ftp.cs.umu.se /pub/uml022.zoo.  For more information contact Olof Johansson
(olof@cs.umu.se).


Poly/ML
-------
Poly/ML is a commercial product from Abstract Hardware Ltd.  (email to
ahl@ahl.co.uk, or browse http://www.ahl.co.uk). The Poly/ML system has
been used to implement a number of high-value tools including ICL's
ProofPower, ViewLogic's ViewSchedule and AHL's own LAMBDA toolset.

Poly/ML 3.0 (Motif Edition) runs on SPARC systems under either
SunOS (4.1) or Solaris (2.3 or later). It also runs on IBM RS/6000 
systems under AIX. The Motif Edition of Poly/ML features native code
generation, a make system, an X11/Xlib interface, and a OSF/Motif interface.
Non-standard extensions include concurrent processes and an associated
message-passing scheme.

The price of the Motif edition of Poly/ML is 1500 pounds for an
academic site licence or 3500 pounds per machine for commercial users.
Multiple and site licences are available by negotiation.

AHL are currently developing a Windows Edition of Poly/ML. This will
run on standard PC hardware under the Windows 95. The release date and
pricing policy for this product have not yet been finalised.


Poplog ML
---------
Standard ML is one of four languages included with the Poplog system,
the others being Pop-11, Prolog and Common Lisp. It uses an
incremental, native-code compiler which implements the full language
described in the Definition; compilation is fast with low memory
usage.  There is an integrated editor and an X interface; these are
both programmable only from Pop-11 but the shared compilation
environment makes it easy to link Pop-11 procedures into ML
programs. This provides a general route for calling out to external
libraries.

Poplog is available for various Unix systems -- Sun SPARC with Solaris
or SunOS, Silicon Graphics, DEC Alpha, HP RISC and Linux -- but also for
VMS, both on Alpha and VAX. It costs money, but there are substantial
discounts for academic users. Sales are handled by Integral Solutions
Ltd. and enquiries should be directed to them at isl@isl.co.uk.

You can get a free demonstration copy of Poplog for Linux/x86 from

    ftp://ftp.cogs.susx.ac.uk/pub/poplog/poplog15.0

This is entirely compatible with the full-price version, but is
unsupported and has certain restrictions: in particular, it has a
limited heap size and cannot make saved images. But it is a working
system and may be of special interest to students who want SML on their
PCs at home.

Adrian John Howard (adrianh@cogs.susx.ac.uk) has a WWW page for Poplog:

    http://www.cogs.susx.ac.uk/users/adrianh/poplog.html


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

4. Unsupported SML/NJ Ports

This section describes various ports of SML/NJ (see section 3) 
that are not directly supported by the NJ folks.  

Linux:
------
(Thanks to Ralf Reetz, Peter Su, and Mark Leone)

This is a port of Standard ML of New Jersey (SML/NJ) to Linux. It is
based on the work of Mark Leone (mleone@cs.cmu.edu) who did the port
for i386/i486 machines. The current binary was compiled using Linux
0.99.7a.  Shared lib 4.3.3.

This port was done by Sanford Barr (sbarr@cs.sunysb.edu) based on the
original port of 0.91 by Hermano Moura (moura@dcs.glasgow.ac.uk) and
Andre Santos (andre@dcs.glasgow.ac.uk).

Various ftp sites seem to carry SML/NJ version 0.93 for Linux:

.tsx-11.mit.edu:/pub/linux/sources/usr.bin/
   ..njsml.93.src.tar.z
..njsml.93.linux.README
..njsml.93.linux.README.NEW
..njsml.93.linux.diffs.z

.ftp.cs.sunysb.edu:/pub/linux/
..njsml.93.bin.z
..njsml.93.mo.i386.z
..njsml.93.linux.README
..njsml.93.linux.diffs.z
..njsml.93.src.tar.z

.ftp.dcs.glasgow.ac.uk:/pub/linux/
..njsml.93.linux.diffs.z
..njsml.93.src.tar.z
..smlnj-0.93-linux.README

16M of ram is suggested if you wish to do anything serious with
the system.  Also, a 386-40 or better would be helpful.

KNOWN BUGS AND DEFICIENCIES:
1 Some minimal precision problems exist when a 387 emulator is
  used.
2 ML functions System.Directory.listDir and System.Directory.getWD not
  working at the moment.
3 There have been reported problems with the Div exceptions 
  (real & int). The problems have been corrected.  See:
.ftp.id.dth.dk (Internet 130.225.76.51)
.file pub/sestoft/sml93-linux99pl12/sml.gz
  That version also allows profiling; see the README file.

OS/2:
-----
Standard ML of New Jersey (version 0.93) for OS/2 has been implemented using
Mark Leone's i386 code generator and the Unix emulator EMX (copyright of
Eberhard Mattes). It is an (almost) complete implementation of SML/NJ 0.93.
Only a few System.* functions have been left unimplemented.

Features of this 2nd release for OS/2:
 * Signal handling
 * Interval timers (real-time, supports CML 0.9.8)
 * 'Garbage flushing', yields better performance on low-memory machines
 * Reduced executable size (well, now it equals the other ports ;-)
 * Exporting supported (also in the binary-only package)
 * Improved MakeML & BindCore utilities
 * Generally more robust
 * Using EMX version 0.8h (the latest release at this moment)

Available from ftp.research.att.com (in /dist/ml/) and, in Europe, from
ftp.id.dth.dk (in /pub/bertelsen/) as:
   93.os2b.exe.zip  Binary-only, SML/NJ interactive compiler (executable)
   93.os2b.src.zip  Sources & documentation
   93.os2b.txt      Introduction
See 93.os2b.txt for system requirements and details on .zip files.

Peter Bertelsen  (c917023@id.dth.dk)
Department of Computer Science, Technical University of Denmark

FreeBSD:
--------
A patch for the standard distribution is available at:
    ftp://pop.cs.cmu.edu/usr/rowan/sml-archive/freebsd/


NEXTSTEP:
---------
The CSDMteam at the University of Munich proudly presents the port of 
Standard  ML of NJ, version 0.93, to NEXTSTEP for Intel processors.

The modified source can be found at ftp.informatik.uni-muenchen.de:
/pub/comp/programming/languages/sml/NJ-0.93/93.src.nsfip.tar.Z (please look 
at the installation instructions in the file README.NeXT.I386).

A precompiled binary of the interpreter (gzip'ed) is located at  
ftp.informatik.uni-muenchen.de:/pub/comp/platforms/next/Developer/languages/ml 
/sml.0.93.I.b.gz.

SVR4:
-----
An mplementation for SVR4.0.4 is available from Anthony Shipman 
(als@tusc.com.au) that fixes the problems with listDir and getWD 
and includes a full malloc implementation for runtime/malloc.c.  
Contact Anthony for more info.


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

5. Where can I find documentation on SML?

THE DEFINITION
--------------
Robin Milner, Mads Tofte and Robert Harper
The Definition of Standard ML
MIT, 1990.
ISBN: 0-262-63132-6

Robin Milner and Mads Tofte
Commentary on Standard ML
MIT, 1991
ISBN: 0-262-63137-7


TEXTS       (date order)
-----
Ake Wikstrom
Functional Programming Using Standard ML
Prentice Hall 1987
ISBN: 0-13-331661-0

Chris Reade
Elements of Functional Programming
Addison-Wesley 1989
ISBN: 0-201-12915-9

Lawrence C Paulson
ML for the Working Programmer
Cambridge University Press 1991
ISBN: 0-521-39022-2

Stefan Sokolowski
Applicative High Order Programming: The Standard ML perspective
Chapman & Hall 1991
ISBN: 0-412-39240-2     0-442-30838-8 (USA)

Ryan Stansifer
ML Primer
Prentice Hall, 1992
ISBN 0-13-561721-9

Colin Myers, Chris Clack, and Ellen Poon
Programming with Standard ML
Prentice Hall, 1993
ISBN 0-13-722075-8 (301pp)

Jeffrey D. Ullman
Elements of ML Programming
Prentice-Hall, 1993 (Oct. 15)
ISBN: 0-13-184854-2
(See Comp.Lang.ML archives, message from Ullman dated 22 Sep 1993 for
 chapter headings.)

Rachel Harrison
Abstract Data Types in Standard ML
John Wiley & Sons, April 1993
ISBN: 0-471-938440

Richard Bosworth,
A Practical Course in Functional Programming Using Standard ML,
McGraw-Hill 1995,
ISBN: 0-07-707625-7.

Elementary Standard ML
Greg Michaelson
UCL Press 1995
ISBN: 1-85728-398-8 PB
(see ftp://ftp.cee.hw.ac.uk/pub/funcprog/gjm.book95.ps.Z for contents
and prologue).


INFORMATION AVAILABLE BY INTERNET
---------------------------------
The following report is available from the LFCS (Mairi McLennan, 
mlm@dcs.ed.ac.uk) and costs 5 pounds or 10 US dollars.  It covers all of
Standard ML.  The report is also available via the World Wide Web off of
http://www.cs.cmu.edu/afs/cs.cmu.edu/project/fox/mosaic/HomePage.html.
Alternatively, the report can be ftp'd from ftp.cs.cmu.edu as the file
/afs/cs/project/fox/mosaic/intro-notes.ps.

Robert Harper
Introduction to Standard ML
LFCS Report Series  ECS-LFCS-86-14
Laboratory for Foundations of Computer Science
Department of Computer Science
University of Edinburgh
Nov. 1986 (revised Jan. 1989 by Nick Rothwell and Kevin Mitchell)


The following report is available from the LFCS (Mairi McLennan,
mlm@dcs.ed.ac.uk) and costs 2.50 pounds or 5 US dollars for single
copies and 1.50 pounds or 3 dollars when bought in bulk.  It includes
an introduction to Standard ML and 3 lectures on the modules system.

Mads Tofte
Four Lectures on Standard ML
LFCS Report Series  ECS-LFCS-89-73
Laboratory for Foundations of Computer Science
Department of Computer Science
University of Edinburgh
March 1989


The following report is available from the LFCS (Mairi McLennan,
mlm@dcs.ed.ac.uk) and is free.  It introduces Extended ML, a language
for writing (non-executable) specifications of Standard ML programs and
for formally developing Standard ML programs from such specifications.

Don Sannella
Formal program development in Extended ML for the working programmer.
LFCS Report Series  ECS-LFCS-89-102
Laboratory for Foundations of Computer Science
Department of Computer Science
University of Edinburgh
December 1989


Le projet Cristal at INRIA Rocquencourt has set up a WWW server for
information regarding its activities, especially the Caml and Caml Light
compilers. The server also offers on-line access to documentation,
publications and to a database of BibTex references in CS.
  Welcome to http://pauillac.inria.fr/
Please report problems and suggestions to Xavier.Leroy@inria.fr.

Richard Botting has taken Larry Paulson's SML Syntax and
translated it into a form that can be read by mosaic, netscape,
lynx and other WWW browsers.  The URL is
"http://www.csci.csusb.edu/dick/samples/ml.syntax.html"

Andrew Cumming has made availible "A Gentle Introduction to ML".  It
is aimed at students who are reasonably computer literate but who are
new to functional programming.  It consists largely of questions and
diversions broken up into roughly one-hour tutorials, most of the
questions have hints which the student can follow up if required.  The
material is intended to be used alongside ML - sections of code may be
copied from the browser window into an ML session.  The URL is
   http://www.dcs.napier.ac.uk/course-notes/sml/manual.html

There are some WWW pages based on an info-tree at MIT with a variety
of useful information on ML.  The URL is:
   http://www.ai.mit.edu/!info/sml/!!first

There is an interesting collection of news articles at:
   http://www.cs.jcu.edu.au/ftp/web/FP/ml.html

The Fox project at CMU has a WWW page for information about Standard ML:
   http://foxnet.cs.cmu.edu/sml.html

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

6. Where can I find library code?

a. The Edinburgh SML Library

 The Edinburgh SML Library provides a consistent set of functions on the
 built-in types of the language and on vectors and arrays, and a few extras.
 It includes a "make" system and a consistent set of parsing and unparsing
 functions.  The library consists of a set of signatures with sample portable
 implementations, full documentation, and implementations for Poly/ML,
 Poplog ML and SML/NJ that use some of the non-standard primitives
 available in those systems.  It is distributed with Poly/ML, Poplog ML and
 Standard ML of New Jersey.  It is also available from the LFCS.

 The library documentation is available as a technical report from the LFCS
 (Mairi McLennan, mlm@dcs.ed.ac.uk) and costs 5 pounds or 10 US dollars.
 The LaTeX source of the report is included with the library.

 Dave Berry
 The Edinburgh SML Library
 LFCS Report Series  ECS-LFCS-91-148
 Laboratory for Foundations of Computer Science
 Department of Computer Science
 University of Edinburgh
 April 1991

b. The SML/NJ Library

 The SML/NJ Library is distributed with the SML of New Jersey compiler.
 It provides a variety of utilities such as 2-dimensional arrays, sorting,
 sets, dictionaries, hash tables, formatted output, Unix path name
 manipulation, etc.  The library compiles under SML/NJ but should
 be mostly portable to other implementations.


c. Caml-light libraries 
   (Included in the Caml Light distribution unless otherwise noted)

CAML-TK
TK is a GUI library for the TCL language. Normally, TK is controlled
from TCL. The Caml-TK interface provides a Caml Light library to control TK
from Caml Light programs. Thus, TK can be used to program graphical
user-interfaces in Caml Light without knowledge of the TCL language.

LIBGRAPH 
The "libgraph" library implements basic graphics primitives (line
and text drawing, bitmaps, basic event processing) for the Caml Light system.
It is portable across all platforms that run Caml Light: X-Windows,
Macintosh, MSDOS.

CAMLWIN
Camlwin is a GUI library for Caml Light that provide all the classical
graphic objects: buttons, string and text editors, list... and a high
level object like windowed file selector. It is based on an extension
of the "libgraph" library and therefore highly portable. Its main
interest is its ability to compile the same code under many systems.
At present time, it works under DOS, Windows, and X11 with unix.
Camlwin is distributed at:
  ftp.inria.fr:lang/caml-light/Usercontribs/camlwin
The reference manual is also available on the WWW at:
  http://liasc.enst-bretagne.fr/~saunier

LIBNUM 
The "libnum" library implements exact-precision rational arithmetic
for Caml Light. It is built upon a state-of-the-art
arbitrary-precision integer arithmetic package, and therefore achieves
very good performance (it's much faster than Maple, for instance).

LIBUNIX 
The "libunix" library makes many Unix system calls and system-related
library functions available to Caml Light programs. It provides Caml
programs with full access to Unix capabilities, especially network sockets.

LIBSTR
The "libstr" library for Caml Light provides high-level string
processing functions, including regular expression matching and
substitution. It is intended to support the kind of text processing
that is usually performed with "sed" or "perl".

d. The Qwertz Toolbox

 The qwertz toolbox, a library of Standard ML modules with an emphasis
 on symbolic Artificial Intelligence programming, may now be obtained
 by anonymous ftp at:
.ftp.gmd.de:gmd/ai-research/Software/qwertz.tar.gz

 The qwertz.tar.gz file is a tar archive compressed using the the GNU
 gzip program.  Use the gunzip program to decompress it.  The
 README file explains how the install the library.  

 The toolbox includes: symbols and symbolic expressions, tables
 including association lists, sets, queues and priority queues,
 streams, heuristic search including A* and iterative deepening,
 and an ATMS reason maintenance system.


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

7. Theorem Provers and ML

(Collected by Paul Black, pblack@cs.berekeley.edu.  Thanks Paul!)

- LCF (Edinburgh LCF and Cambridge LCF)
    * originally written in the Edinburgh dialect of ML from which SML 
      developed.

   "Logic and Computation: Interactive Proof with Cambridge LCF"
    also by Lawrence C. Paulson.  (Describes a Standard ML [core language
    only] version of LCF.)  The port was done by M. Hedlund, then at
    Rutherford Appleton Labs, UK.  It is available by anon. ftp from
    ftp://ftp.cl.cam.ac.uk/ml/lcf.tar.gz.

- Lego (LFCS, Edinburgh Univ., SML)
    * originally developed in CAML
    * latest version (5) now runs under SML/NJ 
    * only higher-order resolution
    * available via anon. ftp from ftp.dcs.ed.ac.uk:/pub/lego

- HOL90 
   Authors = Konrad Slind, Elsa Gunter
   elsa@research.att.com, slind@informatik.tu-muenchen.de
   http://lal.cs.byu.edu/lal/hol-documentation.html
   
   hol90 is a free implementation in SML/NJ of Mike Gordon's HOL logic (a
   polymorphic version of Church's Simple Type Theory). The system provides
   a lot of automated support including:
   
   - a powerful rewriting package;
   - pre-installed theories for booleans, products, sums, natural
     numbers, lists, and trees;
   - definition facilities for recursive types and recursive functions
     over those types (mutual recursion is also handled);
   - extensive libraries for strings, sets, group theory, integers, the
     real numbers, wellordered sets, automatic solution of goals
     involving linear arithmetic, tautology checking, inductively
     defined predicates, Hoare logic, Chandy and Misra's UNITY theory,
     infinite state automata, and many others.

   The HOL community has a lively mailing list accessible at
   info-hol-request@leopard.cs.byu.edu and a yearly user's meeting that
   alternates between Europe and North America. hol90 is available by
   anonymous ftp from

    machine = ftp.informatik.tu-muenchen.de/local/lehrstuhl/nipkow/slind/hol90/
     or
    machine = ftp.research.att.com/dist/ml/hol90/

   Tim Leonard mentions that a description of the variant of ML used in
   HOL88 is online at the following url:

   http://lal.cs.byu.edu/lal/holdoc/Description/ML/ML.html

- NuPrl (from Bob Constable`s group at Cornell)

- Isabelle (Lawrence C. Paulson, Cambridge Univ. )
    * has rewriting, but not many decision procedures.  It does have
.things like model elimination-based decision procedures.
    * a generic automatic theorem prover i.e. you can program it to
.the logic system/proof system you want.  Already has the
.following subsystems already implemented:
..i) FOL - first order logic
..ii) HOL - higher order logic
..iii) LCF - Logic of computable functions
..iv) LK - Gentzen system LK
..v) Modal - Modal logic systems T, S4, S43
..vi) ZF - Zermelo-Fraenkel set theory
    * ftp from ftp://ftp.cl.cam.ac.uk/ml/Isabelle94.tar.gz
    * There's a WWW page:
.http://www.cl.cam.ac.uk/Research/HVG/isabelle.html
    * There's also a mailing list: isabelle-users@cl.cam.ac.uk



- MERILL (Brian Matthews, U. of Glasgow & Rutherford Appleton Laboratory)
    * written in standard ML
    * a general purpose order-sorted equational reasoning system
    * Allows the user to declare their own object language, allows
.AC-rewriting and AC-unification of terms and equations, has
.several completion algorithms, is built on a hierarchy of
.types known as Order-Sorting, and allows the user to try
.different termination methods.
    * available via anonymous ftp from the University of Glasgow,
.ftp address: ftp.dcs.glasgow.ac.uk (130.209.240.50)
    * Brian Matthews, brian@dcs.glasgow.ac.uk or bmm@inf.rl.ac.uk

- FAUST (Karlsruhe)
    * a HOL add-on written in ML.
    * ftp from goethe.ira.uka.de (129.13.18.22)

- Alf
    * written in SML
    * An implementation of Martin-Lofs type theory with dependent types
    * Proof editor
    * available by anonymous ftp from cs.chalmers.se
    * only higher-order resolution

- Coq
    * written in Caml-Light (but Caml-Light and SML are VERY similar)
    * no serious automated reasoning subsystems (other than
.higher-order resolution), but has a VERY nice package for
.program verification.
    * available via anon. ftp from ftp.inria.fr:/INRIA/coq/V5.8
    * possible contact: Chet Murthy <murthy@cs.cornell.edu>

- ICLHOL/ProofPower (ICL Secure Systems)
    * a commercial system using a reimplementation of HOL in SML
    * contact ProofPower-server@win.icl.co.uk

- Lamdba/DIALOG (Abstract Hardware Ltd)
    * a commercial tool written in Poly/ML
    * contact ahl@ahl.co.uk

- Elf (Frank Pfenning, Carnegie Mellon Univ.)
   * Elf is a higher-order logic programming language based on the LF
.Logical Framework.
   * Elf is not a theorem prover per-se, but is useful for specifying
.and proving properties of programming languages, logics, and their
.implementations.  A number of examples are provided with the
.distribution.
   * The Elf implementation is written in SML/NJ and should be easily
        portable to other SML implementations.
   * Elf can be ftp'd from ftp.cs.cmu.edu (128.2.206.173)
.in the directory user/fp/
   * A home page for Elf can be found at http://www.cs.cmu.edu/~fp/elf.html
   * There is an Elf mailing list.  Contact elf-request@cs.cmu.edu to join.
   * For further information, contact Frank Pfenning (fp@cs.cmu.edu).


References
   "ML for the Working Programmer" by Lawrence C. Paulson contains a
.small first-order theorem prover.

    Paulson also has a good chapter on writing theorem provers in ML in
."Handbook of logic in computer science",
.Edited by:  S. Abramsky, Dov M. Gabbay, and T.S.E. Maibaum.
.Oxford : Clarendon Press, 1992-.
.CALL#: QA76 .H2785 1992 

   
Others
    We have an automated theorm proving system here at the University
.of Tasmania, but it is still under development, currently
.riddled with bugs and has an obscure "input language"; aside
.from those minor problems, it'd be perfect...
    La Monte H. Yarroll <piggy@hilbert.maths.utas.edu.au>

    Edinburgh's Concurrency Workbench and Sussex's Process Algebra
.Mauipulator are also ML systems of note, though neither are
.interactive theorem provers.


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

8. Miscellaneous

How do I write the Y combinator in SML without using a recursive
definition (i.e. "fun" or "let rec")?

.datatype 'a t = T of 'a t -> 'a

.val y = fn f => (fn (T x) => (f (fn a => x (T x) a)))
                         (T (fn (T x) => (f (fn a => x (T x) a))))

Where can I find an X-Windows interface to SML?

.Poly/ML, Poplog/ML, and SML/NJ all come with X-Windows interfaces.
.See the appropriate entries under section 3.  In addition, Poly/ML
.interfaces to the industry standard OSF/Motif toolkit.

How do I call a C function from SML/NJ?

See the file runtime/cfuns.c for example C functions that are in
the runtime and callable from ML.  You have to enter the function
into a table at the end of the file along with a string.  You use
the function System.Unsafe.CInterface to look up the function, using
the string as the key.  Note that you'll need to convert ML values
to C representations and back.  You'll have to rebuild the compiler
using makeml.

How do I get the emacs mode to work with Emacs version 19?

Add these three lines at the top of your `sml-init.el' file:
- ----- BEGIN addition
; emacs 19 doesn't have `make-shell', which sml-shell needs, so get it
; when necessary.  12 Oct 1993 M-J. Dominus (mjd@saul.cis.upenn.edu)
(autoload 'make-shell "make-shell" "Make and initialize shell buffer for SML." nil)
- ----- END addition

They tell emacs to load the file `make-shell.el' when it needs to use
the `make-shell' function.  

Then install this file as `make-shell.el' somewhere on your load path,
probably in your emacs `site-lisp' directory:

(defun make-shell (name program &optional startfile &rest switches)
  (let ((buffer (get-buffer-create (concat "*" name "*")))
.proc status size)
    (setq proc (get-buffer-process buffer))
    (if proc (setq status (process-status proc)))
    (save-excursion
      (set-buffer buffer)
      ;;    (setq size (buffer-size))
      (if (memq status '(run stop))
.  nil
.(if proc (delete-process proc))
.(setq proc (apply 'start-process name buffer
...  (concat exec-directory "env")
...  (format "TERMCAP=emacs:co#%d:tc=unknown:"
....  (screen-width))
...  "TERM=emacs"
...  "EMACS=t"
...  "-"
...  (or program explicit-shell-file-name
...      (getenv "ESHELL")
...      (getenv "SHELL")
...      "/bin/sh")
...  switches))
.(cond (startfile
.       ;;This is guaranteed to wait long enough
.       ;;but has bad results if the shell does not prompt at all
.       ;;.     (while (= size (buffer-size))
.       ;;.       (sleep-for 1))
.       ;;I hope 1 second is enough!
.       (sleep-for 1)
.       (goto-char (point-max))
.       (insert-file-contents startfile)
.       (setq startfile (buffer-substring (point) (point-max)))
.       (delete-region (point) (point-max))
.       (process-send-string proc startfile)))
.(setq name (process-name proc)))
      (goto-char (point-max))
      (set-marker (process-mark proc) (point))
      (shell-mode))
    buffer))
