OCaml is a high-level language that supports functional, imperative and object-oriented programming styles. As such, it is an excellent tool for teaching the fundamental concepts behind programming languages, type theory and systems.
For the full description of the benefits of the OCaml language please refer to the article on “Why OCaml?”.
This page is devoted to resources for people who are teaching OCaml in a University setting. It contains a list of courses in different Universities that use OCaml as a teaching language. It can help with setting up a course structure as well as finding the relevant contacts to discuss and share experiences. We also include relevant resources such as references to commonly used textbooks and tools for setting up your preferred environment to work with OCaml. We hope that this will make the task of shaping a programming course that uses OCaml a slightly easier task.
Don't worry if things do not work! OCaml has a vibrant and rapidly growing community behind it that is eager to help. If you find any problems with any of the tutorials or something is missing please let us know by getting in touch so we can help in making your experience with OCaml more pleasant. If you would like to add your course or other resources please feel free to create an issue.
We set-up a mailing list for professors who are teaching OCaml in schools and universities to discuss issues relating to using OCaml in an educational context.
Courses taught in OCaml
Here's a list of courses we know about that teach in OCaml. Please add yours if you don't see it listed!
- Boston College - Computer Science I (CS 1101)
- Brown University - An Integrated introducion (CS 17/18) (along with Racket, Scala and Java)
- Caltech - Fundamentals of Computer Programming
- Columbia University - Programming Languages and Translators
- Cornell University - Data Structures and Functional Programming (CS 3110)
- Harvard University - Principles of Programming Language Compilation (CS153)
- Harvard University - Introduction to Computer Science II: Abstraction & Design (CS51)
- McGill University - Programming Languages and Paradigms (COMP 302)
- Princeton University - Functional Programming (COS 326)
- Rice University - Principles of Programming Languages (COMP 311)
- University of California, Los Angeles - Programming Languages (along with Python and Java) (CS 131)
- University of California, San Diego - Programming Languages: Principles and Paradigms (CSE130-a) (along with Python and Prolog)
- University of Illinois at Urbana-Champaign - Programming Languages and Compilers (CS 421)
- University of Maryland (along with Ruby, Prolog, Java) - Organization of Programming Languages (CMSC 330)
- University of Massachusetts Amherst - Programming Languages (CMPSCI 631)
- University of Massachusetts - Programming Languages (CS691F)
- University of Pennsylvania - Compilers (CIS341)
- University of Pennsylvania - Programming Languages and Techniques I (CIS120)
- University of Virginia - Programming Languages (CS 4610)
- Aarhus University - The compilation course (along with Java)
- Aix-Marseille University - Functional Programming
- Epita - Introduction to Algorithms (Year 1 & 2)
- ISAE/Supaéro - Functional programming and introduction to type systems
- University Pierre & Marie Curie - Types and static analysis (5I555)
- University Pierre & Marie Curie - Models of programming and languages interoperability (LI332)
- University of Birmingham - Foundations of Computer Science (FOCS1112)
- University of Cambridge - Advanced Functional Programming (L28)
- University of Innsbruck - Programming in OCAML (SS 06)
- University of Rennes 1 - Compilation (COMP)
- University of Rennes 1 - Semantics (SEM)
- University of Rennes 1 - Programming 2 (PRG2)
- University of Wrocław - Functional Programming
- Université Paris-Diderot - Advanced Functional Programming (PFAV)
- Université Paris-Diderot - Functional Programming (PF5)
- Indian Institute of Technology, Delhi - Introduction to Computers and Programming (CSL 101) (along with Pascal and Java)
Map of courses around the world
(Tip: Click on the relevant layer (e.g., US,EU), search for your University, click on the marker and click on "Add to map", fill in the info fields and you are done!)
This is a list of books and lecture notes that are being used for teaching OCaml. There is also a wider list of books to choose from, which you can find on the books page.
The OCaml System: Documentation and User's Manual This the official User's Manual. It serves as a complete reference guide to OCaml. Updated for each version of OCaml, it contains the description of the language, of its extensions, and the documentation of the tools and libraries included in the official distribution.
Lecture notes for Penn's CIS120. Like the course, this book covers both OCaml and Java, and is intended for students with no programming background.
Jason Hickey's Introduction to Objective Caml, originally developed as lecture notes for Jason's course at Caltech
This section lists some of the available tools that are or can be used in a classroom or lab.
In the browser
For a quick example of OCaml in the browser, try any of the following:
- IOCaml Notebooks
- Try OCaml
- Compile OCaml Online
- Run OCaml Code Online
Check out our Install OCaml section
This is a list of VM images that some Universities use to avoid setup delays and provide a consistent environment.
- OCaml 4.01 for MAC
- Cornell's Linux VM VirtualBox image (more info here)
- Princeton's Ubuntu VirtualBox VM (more info on the course's site)
- Mirage Virtualbox VMs via Vagrant
Tutorials and Exercises
University tutorials and notes
- From UMass's CS691F Programming languages course
- CSE 130: Programming Languages Course at UCSA. Click on Lectures and Discussion Notes. Have a look at Lec 7 (a pp presentation by Zach) for an inspiring introduction into map and fold.
- CS 3110 Fall 2013 :: Data Structures and Functional Programming at Cornell. The lecturing materials explain OCaml on the basis of the fundamental concepts of functional programming languages.
- CIS 500: Software Foundations at UPenn. A Software Fundations course with strong emphasis on Types. The OCaml Tutorial includes a gentle introduction to the OCaml interactive top-level system and compilation in OCaml.