OCaml

OCaml
编程范型多范型函数式指令式模块化[1]面向对象[2]
语言家族ML
設計者Xavier Leroy英语Xavier Leroy, Damien Doligez英语Damien Doligez, Didier Rémy, Jérôme Vouillon
實作者INRIA
发行时间1996年​(1996
当前版本
  • 5.2.0 (2024年5月13日;穩定版本)[3]
編輯維基數據鏈接
型態系統静态类型推论
操作系统跨平台
許可證GNU宽通用公共许可证
網站ocaml.org 編輯維基數據鏈接
衍生副語言
F#, JoCaml英语JoCaml, MetaOCaml[4]
啟發語言
C, Caml, Modula-2[1], Standard ML
影響語言
ATS英语ATS (programming language), Coq, Elm, F#, F*, Haxe, Opa英语Opa (programming language), Rust, Scala

OCaml/ˈkæməl/ oh-KAM-əl),是一个函数式指令式模块化[1]面向对象通用编程语言。在Xavier Leroy英语Xavier LeroyDamien Doligez英语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法语Guy Cousineau范畴抽象机器英语Categorical abstract machine(CAM)[8],重新实现了Gérard Huet英语Gérard Huet早先的ML方言[9],并用“范畴抽象机语言”的首字母简写将其命名为Caml[10],Caml Light放弃了这个抽象机器又进行了重新实现[11]。OCaml是开放源代码项目,此项目的管理和大部分维护工作,已经交由法国国家信息与自动化研究所(INRIA)。在2000年代早期,来自OCaml的元素被很多语言接纳,特别是F#Scala

  1. ^ 1.0 1.1 1.2 Xavier Leroy. Manifest types, modules, and separate compilation (PDF). Principles of Programming Languages. 1994 [2021-09-06]. (原始内容 (PDF)存档于2021-10-22). 
  2. ^ 2.0 2.1 Didier Rémy. Type inference for records in a natural extension of ML. Research Report RR-1431, INRIA. 1991 [2021-09-10]. (原始内容存档于2022-04-06). 
    Didier Rémy, Jérôme Vouillon. Objective ML: a simple object-oriented extension of ML (PDF). 1997 [2021-09-06]. (原始内容 (PDF)存档于2022-01-21). 
    Didier Rémy, Jérôme Vouillon. Objective ML: An effective object-oriented extension to ML (PDF). 1998 [2021-09-06]. (原始内容 (PDF)存档于2022-01-20). 
  3. ^ OCaml 5.2.0 Release Notes. [2024年5月24日]. 
  4. ^ MetaOCaml -- an OCaml dialect for multi-stage programming. [2021-08-28]. (原始内容存档于2021-08-29). 
  5. ^ Xavier Leroy英语Xavier Leroy. The Caml Light system Release 0.74, documentation and user's guide. 1997 [2021-09-02]. (原始内容存档于2022-03-08). 
  6. ^ Xavier Leroy. The Objective Caml system release 1.07, Documentation and user's manual. 1997 [2021-09-02]. (原始内容存档于2022-01-23). 
  7. ^ A History of Caml. [2021-09-02]. (原始内容存档于2022-04-13). 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.
     
  8. ^ G. Cousineau, P.-L. Curien, M. Mauny. The categorical abstract machine. 1985 [2021-09-03]. (原始内容存档于2021-09-03).  LNCS, 201, Functional programming languages computer architecture, pp.~50-64.
    Michel Mauny, Ascánder Suárez. Implementing functional languages in the Categorical Abstract Machine (PDF). 1986 [2021-09-07]. (原始内容 (PDF)存档于2022-01-28).  LFP '86: Proceedings of the 1986 ACM conference on LISP and functional programming, Pages 266–278.
  9. ^ G. Cousineau, M. Gordon, G. Huet, R. Milner, L. C. Paulson, C. Wadsworth. The ML Handbook, Version 6.2. Internal document. Project Formel, INRIA. July 1985. 
    Christoph Kreitz, Vincent Rahli. Introduction to Classic ML (PDF). 2011 [2021-09-11]. (原始内容 (PDF)存档于2022-01-29). 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. 
  10. ^ Guy Cousineau, Gérard Huet英语Gérard Huet. The CAML primer Version 2.6.1. 1990 [2021-09-07]. (原始内容存档于2022-05-04).  RT-0122, INRIA. pp.78.
    Pierre Weis, Maria Virginia Aponte, Alain Laville, Michel Mauny, Ascander Suarez. The CAML reference manual Version 2.6.1. 1990 [2021-09-07]. (原始内容存档于2022-04-06).  [Research Report] RT-0121, INRIA. pp.491.
  11. ^ Xavier Leroy. The ZINC experiment : an economical implementation of the ML language. 1990 [2021-09-06]. (原始内容存档于2022-04-06).  RT-0117, INRIA.

From Wikipedia, the free encyclopedia · View on Wikipedia

Developed by Tubidy