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
Which syntax to teach ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-10-24 (22:52)
From: Nathaniel Gray <n8gray@g...>
Subject: Re: [Caml-list] Which syntax to teach ?
On 10/24/07, David Teller <> wrote:
>    Hello list,
>  In a few months, I'll start teaching OCaml for the second consecutive
> year. I'll solve a number of my problems by installing Linux on the
> workstations, although I'm pretty sure that will cause no end of
> complaints from the students when they need to continue their work at
> home.
>  Right now, however, that's not the issue. I'm just wondering if I
> should prepare my lectures and exercises using the Original syntax or
> the Revised syntax. The latest looks clearer and possibly easier to
> teach but requires additional command-line arguments to ocamlc and I'm
> not sure I'll be able to find an editor that will display that syntax
> nicely.
>  Any suggestions or experiences ?

As somebody who's TA'ed OCaml-based classes and read a lot of student
code I can make this recommendation: Do NOT encourage your students to
use Emacs unless you enjoy reading unindented code.  This is not a
judgment on the quality of Emacs as a tool for experts, but in the
hands of beginners (apart from highly-motivated ones) it is a source
of frustration and confusion.  They can't get auto-indenting to work.
They can't get syntax highlighting to work.  They can't get the
home/end keys to work.  They can't figure out how to cut and paste.
And thus, they produce truly horrendous code and hate the experience.
The same argument applies to vi.  These tools just do not make any
sense to people raised on modern user interfaces.

There are plenty of modern editors that can handle OCaml syntax
highlighting with no problem.  I use NEdit (you can get my
highlighting mode at, my colleague uses JEdit, there's
Kate, SciTE, and somebody mentioned Eclipse with OCalDE, which may
also be nice for those wanting an IDE.

I know it seems silly to devote so much energy to debating editors,
but I believe it's really important that students have a comfortable
and familiar environment in which to learn.  It's hard enough to learn
functional programming without also having to battle your text editor
every step of the way.

As for original vs. revised syntax, I'm partial to the original
syntax, but only because that's how I learned.  The error messages it
produces are problematic, however.  I do like the "reloaded" syntax
included with 3.10 that is basically original syntax with "end" after
various constructs.


>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- -->