announcing the availability of sml2c

acha@CS.CMU.EDU (Anurag Acharya)
24 Jun 91 17:56:24 GMT

          From comp.compilers

Related articles
announcing the availability of sml2c acha@CS.CMU.EDU (1991-06-24)
| List of all articles for this month |

Newsgroups: comp.compilers
From: acha@CS.CMU.EDU (Anurag Acharya)
Keywords: ML, code, C
Organization: Carnegie Mellon University
Date: 24 Jun 91 17:56:24 GMT

sml2c is a Standard ML to C compiler. It compiles an extended version of SML
to portable C. The extensions include first-class continuations,
asynchronous signal handling, separate compilation and a facility to freeze
and restart programs. It is based on the Standard ML of New Jersey (SML/NJ)
implementation (version 0.67) and shares its front-end and most of the
runtime system. sml2c is a batch compiler and compiles only module-level
declarations, i.e. signatures, structures and functors. It provides the same
pervasive environment for the compilation of these programs as SML/NJ. As a
result, module-level programs that run on SML/NJ can be compiled by sml2c
without any changes. It does not support SML/NJ style debugging and
profiling. Support for profiling may, however, be added in future.

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 has been developed at the School of Computer Science, Carnegie Mellon
University as a part of research into portable implementations of properly
tail-recursive languages with first-class continuations. The design of sml2c
has been described in the technical report

David Tarditi, Anurag Acharya, Peter Lee, "No Assembly required: Compiling
Standard ML to C", School of Computer Science, Carngie Mellon University.

This technical report is available with the distribution as
doc/sml2c/paper/ The distribution also contains "A Guide to SML2C"
(doc/sml2c/manual/manual1.{dvi,ps}) which contains information for
installation and usage.

sml2c is written in SML and the distribution contains both the source sml
files and their C versions (generated by sml2c itself). The distribution
also contains a set of tests and sample programs in the directory tests. The
source for the test programs is available in tests/src. Input files for the
test programs are contained in tests/input and the canonical output files
are contained in tests/canon. doc/smlnj/examples contains some more sample

sml2c is available by anonymous ftp from
( The compressed tar file sml2c.tar.Z can be found in
/usr/nemo/sml2c. Note that the local ftp software will allow you to change
directory only to /usr/nemo/sml2c. In particular, it will not allow you to
change directory to /usr/nemo. This is a feature and not a bug. The size of
the tar file is about 3 Meg. The uncompressed distribution is about 12 Meg.

contact addresses:

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.