Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Teaching OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-02 (12:43)
From: Holger Schulz <schulz@m...>
Subject: Re: [Caml-list] Teaching OCaml

Am 17.05.2004 um 13:28 schrieb Simão Melo de Sousa:

> Because I defend that functional programming (Haskell,
> etc... but Ocaml in particular) has to be teach among other
> "classical" paradigms, I have to prepare a talk about the relevance of
> the functional programming paradigm in general and OCaml in
> particular.

Well perhaps some of the following are useful for you.

1. Functional languages usually come with an interpreter running a 
read-evaluate-print loop. That makes it easy to try examples very 
directly, i.e. without compiling, linking and stuff. The interpreter 
can easily be used for live presentations of examples.

2. In OCaml you have a (strong) type system. That makes the student 
think about the types of the objects they deal with. The type checkers 
gives an immediate response, wether they are right or not.

3. In OCaml you have functional, imperative and object orientated 
elements. Thus you can learn three paradigms within a unified syntax.

4. The imperative elements of OCaml fit into the type system, i.e. you 
have a type for references. That makes you learn the difference between 
a name (or identifier) and a reference (or allocated memory). That's 
better than talking of "variables" without knowing what could be ment. 
Moreover with ":=" or rather "<-" you have a meaningful denotation for 
the assignment, you can learn the difference between assigment and 

4.' The intergration of objects and functional elements show that the 
implementation of methods in object orientation need not to be done 
(totally) functionally.

5. The behavior of functional languages can easily be described by 
semantic models using enviromnents only.

6. Usually students have varying levels of programming experience. Most 
experience comes from imperative and object orientated programming 
languages. The levels are equalizied a bit when using a programmnig 
language, which is not known by almost all students. And you have a 
chance to bring them away from corrupted programmnig styles, they 
learned elsewhere, on using a new language.

7. Functional programming makes it easy to implement mathematical 
definition. That can help unterstanding theoretical aspects.

Some argument are not on teaching OCaml but on teaching OCaml as the 
first language. Our students learn Java as their first languages, I 
don't think they learn to much on programming principles. And I think 
object orientation is hard to understand in the first year.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: