Introduction to the Objective Caml Programming Language

by | Sep 27, 2018 | Programming | 0 comments

This document is an introduction to ML programming, specifically for the Objective Caml (OCaml) programming language from INRIA. OCaml is a dialect of the ML (Meta-Language) family of languages, which derive from the Classic ML language designed by Robin Milner in 1975 for the LCF (Logic of Computable Functions) theorem prover.

OCaml shares many features with other dialects of ML, and it provides several new features of its own. Throughout this document, we use the term ML to stand for any of the dialects of ML, and OCaml when a feature is specific to OCaml.

ML is a functional language, meaning that functions are treated as first-class values. Functions may be nested, functions may be passed as arguments to other functions, and functions can be stored in data structures. Functions are treated like their mathematical counterparts as much as possible. Assignment statements that permanently change the value of certain expressions are permitted, but used much less frequently than in languages like C or Java.

  • ML is strongly typed, meaning that the type of every variable and every expression in a program is determined at compile-time.
  • ML uses type inference to infer types for the expressions in a program.
  • The ML type system is polymorphic, meaning that it is possible to write programs that work for values of any type.
  • ML implements a pattern matching mechanism that unifies case analysis and data destructors.
  • ML includes an expressive module system that allows data structures to be specified and defined abstractly.
  • OCaml is also the only widely-available ML implementation to include an object system.
  • OCaml includes a compiler that supports separate compilation.
  • All the languages in the ML family have a formal semantics.

Introduction to the Objective Caml Programming Language

by Jason Hickey (PDF) – 109 pages

Introduction to the Objective Caml Programming Language by Jason Hickey

Related Posts

42 Free and Paid Programming Resources to Learn Web Development

42 Free and Paid Programming Resources to Learn Web Development

Any serious developer will need to learn how to program in order to really understand what is going on behind the curtain, or if you are curious to wonder about or query how your favorite program works. This is where programming tutorials come in. The following are 42 Free and Paid Programming Resources to Learn Web Development, covering 3 different levels – beginner, intermediate and expert resources.

40 Best Free CSS Learning Resources

40 Best Free CSS Learning Resources

If you are one of the people who love to design using CSS, there are actually thousands of learning resources which you can try out. This post will cover 40 of the best CSS learning resources, covering fundamental concepts, units, selectors, custom properties, animation and many more.

92 Markdown Editors and Tools for All Your Writing Needs

92 Markdown Editors and Tools for All Your Writing Needs

The basics of Markdown are easy to learn, and it can quickly become second nature. We’ve compiled 92 Markdown softwares, editors, tools and resources available that are worth using in a wide variety of scenarios. You’ll also find tutorials and libraries to get your started in no time. Happy writing and programming!