Introduction to Programming in ATS: | ||
---|---|---|
<<< Previous | Next >>> |
There are three built-in libraries in the ATS programming language system: prelude, libc, and libats.
The prelude library provides support for funcions that are commonly needed in practice. The files containing the interfaces for these functions are mostly stored in the directory prelude/SATS. I list some of these files as follows and also briefly explain what these files are for.
prelude/SATS/bool.sats: This package is for boolean values of the type bool, which is mapped to the type int in the C programming language.
prelude/SATS/char.sats: This package is for character values of various types: char for chars, which may or may not be signed, and uchar for unsigned chars, and schar for signed chars. These types are mapped to the types char, uchar and schar in the C programming language.
prelude/SATS/filebas.sats: This package constains some functions for basic file operations.
prelude/SATS/float.sats: This package is for floating point numbers of various types: float for single precision represention, double for double precision represention, and ldouble for long double precision represention. These types are mapped to the following types in the C programming language: float, double, and long double.
prelude/SATS/integer.sats: This package is for finite precision integers of all sorts of types: int for signed integers, uint for unsigned integers, lint for signed long integers, ulint for unsigned long integers, llint for signed long long integers, and ullint for unsigned long long integers. These types are mapped to the following types in the C programming lanuguage: int, unsigned int, long int, unsigned long int, long long int, unsigned long long int.
prelude/SATS/string.sats: This package constains various functions for processing strings.
prelude/SATS/array0.sats: This package is for arrays with size information attached. The functions in it are relatively easy to use but they may incur run-time array bounds checking.
prelude/SATS/list0.sats: This package is for values representing functional lists that are assgined the type list0(T) for some type T.
prelude/SATS/matrix0.sats: This package is for matrices, that is, two-dimensional arrays, with dimension information, that is, the number of rows and the number of columns, attached. The functions in it are relatively easy to use but they may incur run-time array bounds checking.
Note that programming with functions in the prelude library often requires the support of dependent types and linear types, which I will cover elsewhere.
<<< Previous | Home | Next >>> |
Example: A Temptorial Package for Rationals | Up | The libc Library |