![]() | |
编程范型 | 多范型:函数式,指令式,模块化[1],面向对象[2] |
---|---|
语言家族 | ML |
設計者 | Xavier Leroy, Damien Doligez, Didier Rémy, Jérôme Vouillon |
實作者 | INRIA |
发行时间 | 1996年 |
当前版本 |
|
型態系統 | 静态,强,类型推论 |
操作系统 | 跨平台 |
許可證 | GNU宽通用公共许可证 |
網站 | ocaml |
衍生副語言 | |
F#, JoCaml, MetaOCaml[4] | |
啟發語言 | |
C, Caml, Modula-2[1], Standard ML | |
影響語言 | |
ATS, Coq, Elm, F#, F*, Haxe, Opa, Rust, Scala |
OCaml(/oʊˈkæməl/ oh-KAM-əl),是一个函数式、指令式、模块化[1]、面向对象的通用的编程语言。在Xavier Leroy和Damien Doligez,于1990年和1991年实现的ML方言Caml Light之上[5],Didier Rémy和Jérôme Vouillon,于1996年增加了面向对象特征[2],从而形成了“Objective Caml”[6],在2011年时重命名为“OCaml”[7]。
OCaml工具链包括交互式顶层解释器、字节码编译器、优化的本机代码编译器,可逆调试器和一个包管理器(OPAM)。OCaml最初开发于自动定理证明的场景中,并在静态分析和形式方法软件中有超凡的存在感。此外,它在系统编程、网页编程和金融工程及其他应用领域都有严肃的应用。
历史上,Ascánder Suárez于1987年基于Guy Cousineau的范畴抽象机器(CAM)[8],重新实现了Gérard Huet早先的ML方言[9],并用“范畴抽象机语言”的首字母简写将其命名为Caml[10],Caml Light放弃了这个抽象机器又进行了重新实现[11]。OCaml是开放源代码项目,此项目的管理和大部分维护工作,已经交由法国国家信息与自动化研究所(INRIA)。在2000年代早期,来自OCaml的元素被很多语言接纳,特别是F#和Scala。
Our main reason for developing Caml was to use it for sofware development inside Formel. Indeed, it was used for developing the Coq system ……. We were reluctant to adopt a standard that could later prevent us from adapting the language to our programming needs. ……We did incorporate into Caml most of the improvements brought by Standard ML over Edinburgh ML. ……The first implementation of Caml appeared in 1987 and was further developed until 1992. It was created mainly by Ascander Suarez. ……
In 1990 and 1991, Xavier Leroy designed a completely new implementation of Caml, based on a bytecode interpreter written in C. Damien Doligez provided an excellent memory management system. ……In 1995, Xavier Leroy released Caml Special Light, which improved over Caml Light in several ways. In 1995, Xavier Leroy released Caml Special Light, which improved over Caml Light in several ways. First, an optimizing native-code compiler was added to the bytecode compiler. ……Second, Caml Special Light offered a high-level module system, designed by Xavier Leroy and inspired by the module system of Standard ML. ……Didier Rémy, later joined by Jérôme Vouillon, designed an elegant and highly expressive type system for objects and classes. This design was integrated and implemented within Caml Special Light, leading to the Objective Caml language and implementation, first released in 1996 and renamed to OCaml in 2011.
This handbook is a revised edition of Section 2 of ‘Edinburgh LCF’, by M. Gordon, R. Milner, and C. Wadsworth, published in 1979 as Springer Verlag Lecture Notes in Computer Science no 78. ……The language is somewhere in between the original ML from LCF and standard ML, since Guy Cousineau added the constructors and call by patterns. This is a LISP based implementation, compatible for Maclisp on Multics, Franzlisp on VAX under Unix, Zetalisp on Symbolics 3600, and Le Lisp on 68000, VAX, Multics, Perkin-Elmer, etc... Video interfaces have been implemented by Philippe Le Chenadec on Multics, and by Maurice Migeon on Symbolics 3600. The ML system is maintained and distributed jointly by INRIA and the University of Cambridge.