SML is a procedural computer programming language with extremely strong support for higher-order functions and abstraction. It is often called a “functional” language, and it can be used that way, but SML is an imperative language with mutable storage and side effects.
In syntax and semantics, SML stays fairly close to the λ-calculus. For example, just like in the λ-calculus, each function in SML has exactly 1 argument, so if you want to pass more than one thing you need to pack them all together into a data structure.
SML is called a “strongly typed” language, because each type has a well defined meaning which is enforced by SML's typing rules. Because the meanings of types exclude the possibility of ill-defined behavior, it is said that “a well typed SML program can not go wrong”. Although an SML program can (correctly) exit due to an exception if one is raised and not caught, this behavior will be strictly according to the rules rather than being unpredictable.
An SML implementation will automatically calculate most of the types used by a program, and typically very few types need to be written by a programmer.
You can learn about SML from the following resources.
This web site is hosted as part of the “sml” SourceForge project, so the URL http://www.standardml.org/ reaches the same web pages as http://sml.sourceforge.net/.
This SourceForge project is intended to support cooperation among SML compiler teams.
This SourceForge project also hosts two mailing: sml-implementers and sml-list. Unfortunately, these two mailing lists appear to have fallen victim to heavy spamming and their archives are full of spam.
It appears at one point there was an intention to use the CVS repository of this SourceForge project for sharing tests and benchmarks among the various SML compiler projects, but very little has been added.
WARNING: The table of features on this web page is missing a lot of entries for SML.
Despite the problems with the table, at the end of this web page can be found a nice collection of material on the history of SML. Among other things, there are links here to all issues of Polymorphism newsletter, which includes several early proposals for the SML standard.
(Is there a collection of them somewhere?)
This FFI has these advantages:
Advantages:
See the SML/NJ list of special features and the list of SML/NJ deviations on the MLton web site.
Programming with Regions in the MLKit (Revised for Version 4.3.0). Mads Tofte, Lars Birkedal, Martin Elsman, Niels Hallenberg, Tommy Højfeld Olesen, and Peter Sestoft. IT University of Copenhagen. 2006-01.
The ML Kit described above is “the ML Kit with Regions” which first arrived around 1997. Its predecessor is now known as the ML Kit version 1, and it was described in the announcement as follows:
“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.”
See these documentation pages: limitations, incompatibilities, sugar, futures, packages, modules, types.
This compiles Standard ML to C and/or Forth for running on very small machines.
dmoz.org writes:
“Conservative ML extension, has type system to enrich ML with restricted form of dependent types, to allow many interesting program properties: memory safety, termination can be captured in type system and thus be verified while compiling.”
Extensible ML (EML) is an ML-like programming language that adds support for object-oriented idioms in a functional setting. EML extends ML-style datatypes and functions with a class construct designed to be extended into hierarchies, thus allowing the programmer to seamlessly integrate the object-oriented programming paradigm with the traditional functional style.
Extensible ML is related neither to the programming language Extended ML (other than being similarly derived from ML), nor to the specification language eXtensible Markup Language, nor to extensible programming.
Millstein, Bleckner, Chambers. Modular typechecking for hierarchically extensible datatypes and functions. Proceedings of the seventh ACM SIGPLAN international conference on Functional programming, ACM Press, 2002.
This is Dominic Duggan's extension of SML/NJ with type error explanation.
MLj compiles SML into bytecode that runs on the JVM.
It seems that the company that developed it (Persimmon IT) is defunct and sold out to Microsoft which converted the code base to target the .NET platform instead, resulting in SML.NET. At least that is my conclusion reading between the lines of the MLj web page.
Based on an old version of SML/NJ from 1992 (version 0.67?).
Some details (and a .zip file download of personal edition?) can be found here:
http://web.archive.org/web/20030801205546/http://burks.bton.ac.uk/burks/language/ml/index.htm
Web page which is not working properly but is sort of readable: http://ellemose.dina.kvl.dk/~sestoft/msp/index.msp
Directory currently ( http://www.itu.dk/people/sestoft/msp/
) containing everything except the .msp page mentioned just above:Author's current home page: http://www.itu.dk/people/sestoft/index.html
Look at the files with names beginning with “uml” in this FTP directory: ftp://ftp.cs.umu.se/pub/
The code is very sparsely commented.
ExSML is a port of Moscow ML to use LLVM as its back end, replacing Moscow ML's CaML-derived back end. It seems to have gotten stuck in mid-2009 before finishing.
Most SML implementations (not just SML/NJ) include the SML/NJ library which provides a number of additional useful features not included in the standard basis.
The SML/NJ web site has partial documentation for the SML/NJ library.
Unfortunately, there are some features in the SML/NJ library that are only currently documented in the source code. The important files to read are the ones containing the definitions of signatures, which are generally well commented. It is worthwhile to fetch and unpack the source code for the SML/NJ library for a recent working version of SML/NJ to get these signature files. You unpack this file with a command like this:
tar xfz smlnj-lib.tgz
See also http://www.daimi.au.dk/designCPN/sml/libs/smlnj.html.
Dave Berry LFCS Report Series ECS-LFCS-91-148
http://www.lfcs.inf.ed.ac.uk/reports/91/ECS-LFCS-91-148/
“It is distributed with Poly/ML, Poplog ML and Standard ML of New Jersey.” WTF?
Source can be found here: http://www.daimi.au.dk/designCPN/sml/libs/esml.html
Source can also be found at this location:
http://www.cs.bham.ac.uk/research/projects/poplog/src/master/contrib/pml/smllib/library/
Unfortunately, that location doesn't include the SML/NJ and Poly/ML compatibility code, only the Poplog ML compatibility code.
Lessons from the design of a Standard ML library Dave Berry Journal of Functional Programming (1993), 3: 527-552 DOI: 10.1017/S0956796800000873
At this site are listed these:
You have to look at the project page to find the latest version, which is not linked from the home page.
WARNING: Avoid the obsolete old location of sml-ext at googlecode.
This is contained within the Tom 7 Misc SourceForge project, which also contains some other SML stuff (and also some C++ stuff).
WARNING: Avoid the obsolete old location of sml-lib in the neighboring CVS repository (also in the Tom 7 Misc SourceForge project), because that version of sml-lib is no longer being updated.
symbolic Artificial Intelligence programming
ftp.gmd.de:gmd/ai-research/Software/qwertz.tar.gz
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.
This includes patches to make various libraries compile with modern SML compiler distributions:
Includes:
Includes:
Includes:
http://rads.stackoverflow.com/amzn/click/0137903871 (check link corresponds to title/author!)
http://rads.stackoverflow.com/amzn/click/0201398206 (check link corresponds to title/authors!)
Greg warns: “... my SML material is the old standard. So there are things I do which may no longer work. In particular, I do not use the standard libraries for I/O, building everything from scratch, and I make heavy use of partial application [which often fails with the new value polymorphism restriction] ...”
Norman Ramsey: “Actually “extended quick-reference card” is a better description. Runs about 20 pages. Highly recommended to have with you when hacking.”
Norman Ramsey: “A good overview of the ML language. Lecture 2 has many nice examples of use of the modules system, and lecture 3 is the best explanation I have seen of the static semantics of modules (signature matching and constraints).”
This gives an alternative to SML's built-in tuples (which are actually records with numeric field labels). The point is that it lets you define functions that operate on tuples of arbitrary size in an inductive fashion.
This shows how to define functions that look and act like the “for loop” constructs of other programming languages.
This discusses how to emulate the “return” statement of other programming languages.
This discusses how to define functions that can take an arbitrary number of (curried) arguments, i.e., you can have a function F such that (F A1 A2 A3 ⋯ An) makes sense for any value of n. (Remember that this is really (( ⋯ (((F A1) A2) A3) ⋯) An).)
This is an advanced use of the fold pattern that deals with some special cases that can sometimes arise for which fold itself is not enough.
This gives you polymorphic functions over tuples built with the user-defined binary product operator mentioned above.
SML's built-in tuples (records with numeric field labels) are not handled by this pattern. (Can they be handled some other way?)
This web page also discusses how Berthomieu's method fails due to type system restrictions for classes where the non-constructor methods of the class might need to call a constructor of the same class.
Date: 2012-02-13 12:04:33