The HimML language is a close cousin to the Standard ML language [6, 9]. Actually, it is Standard ML
without its module system (as of October, 1992), but
with some extensions and with a specially designed run-time system.
This document is a reference for HimML version 1.0 alpha 17. It does
assume some knowledge of the syntax, static and dynamic semantics of
the Standard ML language, and builds on this knowledge.
The plan of the document is as follows. In the rest of chapter 1, we
quickly describe what makes the originality of HimML. Chapter 2 is
devoted to the differences between HimML and Standard ML; they are
mainly extensions, but some are mere differences. Chapter 3 lists the
types and values provided upon booting the HimML executable; others
are defined in source form, with their own documentation. There is no
guide to the syntax of HimML, for which the reader is referred to
[6], and to the appropriate sections of this report when
HimML syntax differs from the Standard ML syntax.
Chapter 4 discusses running the system, and also how you can
contribute to improve it, either by reporting bugs or suggesting
changes.
The run-time system is
architectured around the concept of maximal sharing, or systematic
hash-consing [4], in which two identical objects in the
heap lie exactly at the same address. This makes comparison fast,
though memory management may suffer a bit occasionally. However, this
approach has a lot of advantages in terms of memory usage (reuse of
objects) and of speed (via memoization and
computation sharing); these points are addressed in [4].
The main feature added to Standard ML in HimML is the collection of
set and map operations, types and
syntactic constructs. A set in HimML means a finite collection
of objects of the same type, where order and multiplicity are
irrelevant. A map looks like a set: it is a finite collection of
associations, called maplets, from objects of a
type t1
to objects of a type t2
, forming a many-to-one
relation. Because maps subsume sets, sets of objects of type t
are just defined in HimML as maps from objects of type t
to the
special object ()
, the empty tuple. The need for sets and maps as basic type constructors in programming
languages is advocated in [3]. In HimML, sets and maps
form the core of the language, and, thanks to maximal sharing,
operations on sets and maps are very fast. It is encouraged to write
HimML programs as executable specifications in a
set-theoretic framework, for it is easy and in general more efficient
than we think it could be in advance.
Another feature added in HimML is its typing of numerical
values with a
notion of measure units. This scheme allows to detect
inconsistencies in scientific programs, where the problem lies not in
the structure of data (numbers) but in the nature of what they
describe (units).
We shall often refer to the Standard ML language, as defined in
[6] and [9]. Sometimes, it will be necessary to
distinguish particular features of a prominent implementation of
Standard ML, called Standard ML of New Jersey or
SML-NJ (unpublished documentation, provided with the 1991
release of SML-NJ).
Note that there is a difference between the sign …, that is
used to describe a repetition of objects in the syntax, and the sign
...
, which is a lexeme, used in tuple and record patterns, and
also in extensible types (an extension to Standard ML's type system).