[Teaching] Asking teachers: what support would you want to distribute OCaml to students ?

Kim Nguyễn Kim.Nguyen at lri.fr
Wed Nov 26 09:43:05 GMT 2014

Hi Louis, hi everyone,

first, thanks for the very nice work on opam and tooling around OCaml.
Thanks also to get discussion started on this teaching mailing list :-)

a bit of context: I'm participating in several courses:
Introduction to Functional Programming, 2nd year of bachelor curriculum (L2)
Advanced Functional Programming 3rd year of bachelor curriculum (L3)
Compiler (I handle a semester-long project where student write a foo
to mips compiler,
foo being a subset of C, Java, Go, Python so far).

So I'm only answering with students following such courses in mind.
Sorry, it turned out to
be a longer answer than I expected :

On Wed, Nov 26, 2014 at 8:23 AM, Louis Gesbert
<louis.gesbert at ocamlpro.com> wrote:
> Hello,
> 1/ What systems does it need to work in ? Does that include Windows ? (and
> Cygwin ?)

Yes. A thouthand times yes. Windows, possibly without cygwin.
Especially for the L2 course, the student are still in a Math-Info
curriculum, they might need mathlab/mapple and such. Telling them to
install a dual boot or boot an usb linux thumbdrive to work with OCaml
is possible of course but still not very welcoming.
Those using OS X or linux have had no problem installing OCaml through
packages or opam, and I can easily help by spending no more than a few
minutes. Installing on windows still is problematic and, when it
fails, leaves even an advanced sysadmin dumbfounded.

> Eg. what OS, and within controlled or heterogeneous installations ? We may
> be lacking easy way to install OCaml + tools easily on some platforms, but
> the issue is a bit different if we require a more strictly consistent
> installation across machines.

There are two situations:
1) machine we provide in our labs, installed by the university sysadmin
2) students personnal machine.

For 1) we are lucky enough to have a dedicated sysadmin that install
pretty much everything we ask. The sysadmin obviously prefers using
the distro packages than opam (just because the installation is
replicated on thousands of machines and he just ticks the name of a
packages in his big list and replicate the install automatically).

For 2) as you may imagine, students have very heterogenous
hardware/distro, but most of the time its:
- a mac, with recent OS X : opam works well there (but sometimes
students don't know about it and use some package manager and it also
works well)
- a pc with linux : here no problem, they often have a recent distro
(Ubuntu or Debian most of the time)
- a pc with windows : a fairly recent version of windows: some of them
manage to download a binary version of OCaml and call it from the dos
prompt, but its not ideal.

> 2/ What form should the distribution be in ?
> Restricting to OSX and major, not too outdated Linux distributions, getting
> OPAM and installing a selected set of packages on a given OCaml version
> should be fairly straightforward. Situation is not as bright if we want to
> extend on that.

Honestly, _for the courses I mentioned above_ (i'm stressing that, I
know that this is not what your average OCaml programmer needs), the
students don't need much:

- the ocaml compiler
- a tool to build a small project (most of the time we rely on Make
for the compilation course, and the student write ocamlc invocation by
hand in L2/L3 since they often write one-file programs. Ocamlbuild
works nicely for such courses too).
- maybe one extra package (menhir for the compilation course)

No camlp4 extension, no huge framework like core, batteries and so on.

So really, opam as it is (and if it worked on windows), would be more
than sufficient. What is need as far as teaching is concerned however
is a working graphic library (cross platform, that allows to do also a
bit of simple audio and with better support for input (mouse
buttons)). This in turn may require some system library to be
installed. I think if opam could just suggest how to install that
library for the current platform it would be enough.

A widget library would be nice, but those often come with an OO API,
which we don't want to teach for beginners course (they already have
problems with functional programming).

> We are on two parallel tracks to improve on that:
> 3/ opam-in-a-box

This is really overkill for these courses. Again starting a VM just to
program in OCaml feels a bit silly
"after all we don't need all that to program in Java, we just start
eclipse and that's it"
(I'm just playing the devil's advocate by quoting the students).

> 4/ interface and documentation
> Pre-configured installations of vim and emacs should be part of this. It
> gets more delicate to include graphical tools if we're using a VM ; but web
> tools (tryocaml [9], iOCamlJS [10]...) may be served from the VM.

They can find the OCaml documentation online + tutorials and it works fine.
Students rarely use emacs nor vim. I tell them to do so, I install
tuareg mode for them, with easy keyboard shortcuts, but they don't
like emacs.
the concept of window vs buffer is puzzlying to them. they often open
several emacs windows (processes) each with several buffers...

To my dismay they either use gedit (on linux) or sublime text editor
(a... shareware :-( which bugs you sometimes when you try to save).
That editor just works: syntax highlighting, tabbed editor, nice
navigation features and syntactic completion (based on the symbols
that have already been typed).
So yes, the problem of having a good editor, especially for beginers
is still there.

Sorry if the answer turns out to not be around opam that much but
around the editor/libraries. After all, the students install once, at
the begining of the semester and then only program (they don't use
opam to switch compilers, install packages or what not).

Best regards,

More information about the Teaching mailing list