What is OCaml?
OCaml is a functional programming exquisite language with an emphasis on expressiveness and safety. The OCaml language underlies the Tezos protocol. Tezos is a smart-contracts platform that includes a way for the protocol to be upgraded through a governance system. The system is created so that the blockchain can evolve instead of performing hard forks which may lead to transactions not being confirmed by out-of-date nodes.
- A powerful type system, equipped with parametric polymorphism and type inference. For instance, the type of a collection can be parameterized by the type of its elements. This allows defining some operations over a collection independently of the type of its elements: sorting an array is one example. Furthermore, type inference allows defining such operations without having to explicitly provide the type of their parameters and result.
- User-definable algebraic data types and pattern-matching. New algebraic data types can be defined as combinations of records and sums. Functions that operate over such data structures can then be defined by pattern matching, a generalized form of the well-known switch statement, which offers a clean and elegant way of simultaneously examining and naming data.
- Automatic memory management, thanks to a fast, unobtrusive, incremental garbage collector.
- Separate compilation of standalone applications. Portable bytecode compilers allow creating stand-alone applications out of Caml Light or OCaml programs. A foreign function interface allows OCaml code to interoperate with C code when necessary. Interactive use of OCaml is also supported via a “read-evaluate-print” loop.
- OCaml is used to implement Tezos, due it is a well-defined language, which makes it good for formal specifications. Tezos is projected to launch soon. It is one of the most promising upcoming blockchain projects.
About This Course
Functional programming is a programming paradigm which is rapidly attracting interest from a broad range of developers because it allows to write expressive, concise and elegant programs.
In this MOOC you will learn Functional programming using the OCaml programming language.You will discover the powerful mechanisms that are offered to build and manipulate complex data structures in a clean and efficient way. And you will see how functions play a central role, as first-class values that can be freely used in any place where an expression can appear.
The OCaml programming language is a member of the ML language family pioneered by Robin Milner. An important feature of OCaml is that it reconciles the conciseness and flexibility of untyped programming languages (like Python, for example) with the safety of strongly typed programming languages (like Java, for example). The OCaml compiler performs in fact a type inference. Types of identifiers do not have to be declared but are inferred by the compiler at the moment of definition of an identifier, and then used for assuring type correctness when using an identifier.
We will start by using OCaml as a purely functional programming language. At the end of this MOOC we will see that OCaml is in fact a multi-paradigm language which allows you to combine the functional programming style with the imperative programming paradigm.
This course will be held in English. To follow this course we expect from you that you have already some basic knowledge of informatics, in particular you should already know how to write simple computer programs in some programming language. For instance, you should know concepts like variables (or identifiers), functions (or procedures, methods), conditionals, and loops.
- Week 0: Introduction and overview
- Week 1: Basic types, definitions and functions
- Week 2: Basic data structures
- Week 3: More advanced data structures
- Week 4: Higher order functions
- Week 5: Exceptions, input/output and imperative constructs
- Week 6: Modules and data abstraction
Register here: LINK
For more info: https://www.fun-mooc.fr/courses/course-v1:parisdiderot+56002+session03/about