Caml is a general-purpose, powerful, high-level programming language with a large emphasis on speed and efficiency. A dialect of the ML programming language, it supports functional, imperative, and object-oriented programming styles. Caml has been developed and distributed by INRIA, a French research institute, since 1985.
The OCaml system is the main implementation of the Caml language. It has a very strong type-checking system, offers a powerful module system, automatic memory management, first-class functions, and adds a full-fledged object-oriented layer. OCaml includes a native-code compiler supporting numerous architectures, for high performance; a bytecode compiler, for increased portability; and an interactive loop, for experimentation and rapid development. OCaml’s integrated object system allows object-oriented programming without sacrificing the benefits of functional programming, parametric polymorphism, and type inference. The language is mature, producing efficient code and comes with a large set of general purpose as well as domain-specific libraries.
OCaml is often used for teaching programming, and by large corporations. OCaml benefits from a whole range of new tools and libraries, including OPAM (package manager), optimizing compilers, and development tools such as TypeRex and Merlin.
OCaml was written in 1996 by Xavier Leroy, Jérôme Vouillon, Damien Doligez, and Didier Rémy at INRIA in France.
Here’s our recommended tutorials to learn OCaml. If you’re looking for free OCaml programming books, check here.
1. OCaml tutorials by OCaml.org
Here’s a wide variety of OCaml tutorials.
2. How to wrap C functions to OCaml by Florent Monnier
This document is a small tutorial that introduces how to call C functions from OCaml. Which is useful if you want to make a mixed C and OCaml application, if you want to call some functions you need from a C library, or to write a complete binding to a C library.
3. Tutorial: OCaml for scientific computation by Dr. Thomas Fischbacher
Tutorial: OCaml for scientific computation covers most of the OCaml features that are used in the nsim library which is used by nmag.
4. Learn OCaml in Y minutes by Daniil Baturin
OCaml is a strictly evaluated functional language with some imperative features.
5. Crash course on the OCaml ecosystem
This tutorial is intended to get you up and running quickly with OCaml.
6. Try OCaml by OCamlPro SAS
This site offers some lessons to help you get started.
All tutorials in this series:
|Free Programming Tutorials|
|Java||General-purpose, concurrent, class-based, object-oriented, high-level language|
|C||General-purpose, procedural, portable, high-level language|
|Python||General-purpose, structured, powerful language|
|C++||General-purpose, portable, free-form, multi-paradigm language|
|C#||Combines the power and flexibility of C++ with the simplicity of Visual Basic|
|PHP||PHP has been at the helm of the web for many years|
|Ruby||General purpose, scripting, structured, flexible, fully object-oriented language|
|Assembly||As close to writing machine code without writing in pure hexadecimal|
|Swift||Powerful and intuitive general-purpose programming language|
|Groovy||Powerful, optionally typed and dynamic language|
|Go||Compiled, statically typed programming language|
|Pascal||Imperative and procedural language designed in the late 1960s|
|Perl||High-level, general-purpose, interpreted, scripting, dynamic language|
|R||De facto standard among statisticians and data analysts|
|COBOL||Common Business-Oriented Language|
|Scala||Modern, object-functional, multi-paradigm, Java-based language|
|Fortran||The first high-level language, using the first compiler|
|Scratch||Visual programming language designed for 8-16 year-old children|
|Lua||Designed as an embeddable scripting language|
|Logo||Dialect of Lisp that features interactivity, modularity, extensibility|
|Rust||Ideal for systems, embedded, and other performance critical code|
|Lisp||Unique features - excellent to study programming constructs|
|Ada||ALGOL-like programming language, extended from Pascal and others|
|Haskell||Standardized, general-purpose, polymorphically, statically typed language|
|Scheme||General-purpose, functional, language descended from Lisp and Algol|
|Prolog||General purpose, declarative, logic programming language|
|Forth||Imperative stack-based programming language|
|Clojure||Dialect of the Lisp programming language|
|Julia||High-level, high-performance language for technical computing|
|SQL||Access and manipulate data held in a relational database management system|
|Erlang||General-purpose, concurrent, declarative, functional language|
|VimL||Powerful scripting language of the Vim editor|
|OCaml||General-purpose, powerful, high-level language|
|Awk||Versatile language designed for pattern scanning and processing|
|Racket||Platform for programming language design and implementation|
|BASIC||Family of general-purpose, high-level programming languages|
|LaTeX||Professional document preparation system and document markup language|
|Elixir||Relatively new functional language that runs on the Erlang virtual machine|
|Dart||Client-optimized programming language for fast apps|
|ABAP||Advanced Business Application Programming|
|F#||General purpose, strongly typed, multi-paradigm language. Part of ML|
|Chapel||Parallel-programming language in development at Cray Inc.|
|Dylan||Multi-paradigm language, supports functional & object-oriented programming|
|D||General-purpose systems programming language with a C-like syntax|
|Solidity||Object-oriented, high-level language for implementing smart contracts|
|XML||Set of rules for defining semantic tags that describe the structure and meaning|
|Vala||Object-oriented language with a self-hosting compiler that generates C code|
|ECMAScript||Best known as the language embedded in web browsers|
|Kotlin||Statically typed, general-purpose programming language with type inference|
|Markdown||Plain text formatting syntax designed to be easy-to-read and easy-to-write|
|Pike||Interpreted, general-purpose, high-level, cross-platform, dynamic language|
|HTML||HyperText Markup Language|
|Factor||Dynamic stack-based language|
|Objective-C||General purpose language which is a superset of C|
|Standard ML||One of the two main dialects of the ML language|
|Alice||Educational language with an integrated development environment|
|Agda||Dependently typed functional language based on intuitionistic type theory|
|Icon||High-level, general-purpose language|
|PureScript||Small strongly, statically typed language with expressive types|
|Tcl||Dynamic language based on concepts of Lisp, C, and Unix shells|