$ whois ocaml
OCaml
first released in 1996 · by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy, Ascánder Suárez
$ guessprog --inspect ocaml
- year
- 1996
- paradigm
- functional
- family
- ml
- memory
- automatic gc
- binding
- static
- safety
- strong
OCAML(7)
- AUTHORS
- Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy, Ascánder Suárez
- HISTORY
- OCaml was released in 1996 as Objective Caml by a team at INRIA, the French national research institute for computer science, including Xavier Leroy, Jérôme Vouillon, Damien Doligez and Didier Rémy. It extended Caml, a dialect of ML developed at INRIA since the 1980s, with an object system and a fast native-code compiler. Like ML, it grew up around theorem proving: the Coq proof assistant, now called Rocq, is written in OCaml. The language was officially renamed OCaml in 2011.
- USAGE
- A niche but influential language. OCaml is used for compilers, static analysis and formal verification tools, and in industry most famously at the trading firm Jane Street, which runs most of its systems on it.
- SEE ALSO
- OCaml on Wikipedia ↗
type expr =
| Num of int
| Add of expr * expr
| Mul of expr * expr
let rec eval = function
| Num n -> n
| Add (a, b) -> eval a + eval b
| Mul (a, b) -> eval a * eval b
let () =
let e = Add (Num 2, Mul (Num 3, Num 4)) in
Printf.printf "result = %d\n" (eval e)