Chapter 15. Objective Caml

Caml, the Categorial Abstract Machine Language, was developed at the french research institute INRIA starting in the mid 1980's. Besides Standard ML, it is the second main ML dialect in use. Objective Caml (Ocaml for short) add object-oriented features to this ML dialect.

This chapter does not assume that you know Standard ML or have read the previous chapter. The differences between the two ML dialects, although mostly syntactical, are significant enough to justify starting from scratch. We will, however, point out the differences between SML and Ocaml as we encounter them.

15.1. Software and Installation

The main Ocaml site gives access to the various tools and documentation. For the examples in this chapter I am using the interactive interpreter ocaml and the byte code compiler ocamlc version 3.04 on Linux. Starting the ocaml interpreter, we receive a short welcome message and enter Ocaml's command line.

ahohmann@kermit:~$ ocaml
        Objective Caml version 3.04

# 

We will begin our examples using the interpreter which gives us immediate feedback and then turn to the compiler as soon as the programs become to large to be entered at the command line.