ATS: Programming with Theorem-Proving/Installing and operating the ATS compiler

Installing ATS
NOTE: these instructions have been tested on Ubuntu Linux, and may need to be changed for other distributions.

On Linux, the first step is to download the stable version of the current ATS compiler, ATS/Anairiats. The filename should be along the lines of "ats-lang-anairiats-x.x.x.tar.gz", where "x.x.x" stands for version. Then you can install either into  or into some directory under your home directory.

Installing into
Open a terminal and invoke

Now add this to the environment:

Installing into home directory
If you choose to install in a different directory, say, untar into some temporary directory first:

Then move  to  :

And then add the following to :

An explanation of the meaning of the two environment variables is in order. Both are assumed to be non-empty.


 * is an absolute path to the ATS installation directory
 * is a version of the installed ATS compiler, and is used for name mangling in the generated code

The first program
For testing, please write the following in your favorite text editor:

and save it into a file named. Then please issue the following command-line:

If everything goes fine, then  is a newly generated executable, which should print the string "Hello, world!" and a newline onto the console when executed.

File extensions
There are two major types of files you'll be interested in:
 * files containing module interface, having the extension  (the first letter comes from "statics")
 * files containing implementation of interface, with the extension  (the first letter comes from "dynamics")

The meaning of "statics" and "dynamics" will be explained later.