欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
ML
小 (→项目) |
小 (→文档) |
||
(未显示1个用户的34个中间版本) | |||
第6行: | 第6行: | ||
ML 是一个通用的函数式编程语言,它是由爱丁堡大学的 Robin Milner 及他人在二十世纪七十年代晚期开发的。它的语法是从 ISWIM 得到的灵感。作为元语言的ML是为了帮助在 LCF 定理证明机中寻找证明策略而构想出来的。(之前的元语言是 pplambda,它联合了一阶逻辑演算和有类型的多态的λ演算)。它使用了 Hindley-Milner 类型推论算法来推测大多数值的类型,而不需要四处使用注解。 | ML 是一个通用的函数式编程语言,它是由爱丁堡大学的 Robin Milner 及他人在二十世纪七十年代晚期开发的。它的语法是从 ISWIM 得到的灵感。作为元语言的ML是为了帮助在 LCF 定理证明机中寻找证明策略而构想出来的。(之前的元语言是 pplambda,它联合了一阶逻辑演算和有类型的多态的λ演算)。它使用了 Hindley-Milner 类型推论算法来推测大多数值的类型,而不需要四处使用注解。 | ||
− | *[https://docs.huihoo.com/ml/smlfamily/history/index.html History of Standard ML] | + | *[https://docs.huihoo.com/ml/smlfamily/history/index.html History of Standard ML] [https://smlfamily.github.io/history/SML-history.pdf The History of Standard ML 2020版] |
*[https://docs.huihoo.com/ml/smlfamily/history/ML2015-talk.pdf The History of Standard ML: Ideas, Principles, Culture] [https://docs.huihoo.com/ml/smlfamily/history/SML-history.pdf The History of Standard ML] | *[https://docs.huihoo.com/ml/smlfamily/history/ML2015-talk.pdf The History of Standard ML: Ideas, Principles, Culture] [https://docs.huihoo.com/ml/smlfamily/history/SML-history.pdf The History of Standard ML] | ||
+ | |||
+ | [https://www.polyml.org/documentation/Papers/poly/intro.html Introduction to Poly] | ||
+ | |||
+ | ==ML & Lisp== | ||
+ | Lisp was the language in which the Stanford LCF system was implemented and also served as its “meta-language.” The design of ML for Edinburgh LCF was informed by Milner’s experience at Stanford; in fact, LCF/ML was implemented by translation into Stanford Lisp code.《The History of Standard ML 2020版》86:7 | ||
+ | |||
+ | Lisp 是实现斯坦福 LCF 系统的语言,同时也是其"元语言"。为爱丁堡 LCF 设计的 ML 是由 Milner 在斯坦福大学的经验提供的。事实上,LCF/ML 是通过翻译成斯坦福 Lisp 代码实现的。 | ||
==功能== | ==功能== | ||
第16行: | 第23行: | ||
不像Haskell,ML使用及早求值,也就是说所有的子表达式总是被求值。导致的一个结果是你不能使用无穷表。然而,惰性求值产生的无穷表可以通过使用匿名函数来模拟。 | 不像Haskell,ML使用及早求值,也就是说所有的子表达式总是被求值。导致的一个结果是你不能使用无穷表。然而,惰性求值产生的无穷表可以通过使用匿名函数来模拟。 | ||
− | 今天在ML家族中有好几种语言:两种主要的方言是Standard | + | 今天在ML家族中有好几种语言:两种主要的方言是Standard ML和 [[OCaml]],其他的包括F#-针对Microsoft .NET平台的开放研究项目。ML中的思想影响了众多的语言,例如Haskell,Cyclone和Nemerle。 |
− | + | ML的实力大多被用于语言设计和操作(编译器构建、自动化定理证明和[[formal verification|形式化验证]]),但是它作为通用语言也被用于生化,金融系统,和宗谱数据库,一个P2P的客户/服务器程序等等。 | |
+ | |||
+ | Standard ML provides modules [called `structures'] with interfaces [called `signatures']. | ||
==标准== | ==标准== | ||
*[https://github.com/SMLFamily/Successor-ML Successor ML] 是用来描述ML语言的下一个版本的术语 | *[https://github.com/SMLFamily/Successor-ML Successor ML] 是用来描述ML语言的下一个版本的术语 | ||
− | *[https://github.com/SMLFamily/The-Definition-of-Standard-ML-Revised SML97] | + | *[https://github.com/SMLFamily/The-Definition-of-Standard-ML-Revised SML97] [https://smlfamily.github.io/Basis/ The Standard ML Basis Library] [https://people.mpi-sws.org/~rossberg/sml.html Standard ML Grammar] of SML97 |
*[https://github.com/SMLFamily/The-Definition-of-Standard-ML SML90] | *[https://github.com/SMLFamily/The-Definition-of-Standard-ML SML90] | ||
*[http://flint.cs.yale.edu/flint/publications/ml2000.html ML2000] | *[http://flint.cs.yale.edu/flint/publications/ml2000.html ML2000] | ||
+ | |||
+ | [[文件:Standard-ML-97-seven-sections.png]] [https://smlfamily.github.io/sml97-defn.pdf SML97] | ||
+ | |||
+ | *Syntax of the Core | ||
+ | Reserved Words | ||
+ | abstype and andalso as case datatype do else | ||
+ | end exception fn fun handle if in infix | ||
+ | infixr let local nonfix of op open orelse | ||
+ | raise rec then type val with withtype while | ||
+ | ( ) [ ] { } , : ; ... _ | = => -> # | ||
+ | |||
+ | *Syntax of Modules | ||
+ | Reserved Words | ||
+ | eqtype functor include sharing sig | ||
+ | signature struct structure where :> | ||
+ | |||
+ | *Static Semantics for the Core(49 Inference Rules 推理规则) | ||
+ | *Static Semantics for Modules (50-89,40 Inference Rules) | ||
+ | *Dynamic Semantics for the Core(90-149,60 Inference Rules) | ||
+ | *Dynamic Semantics for Modules(150-186,37 Inference Rules) | ||
+ | *Programs(187-189,3 Inference Rules) | ||
==指南== | ==指南== | ||
第39行: | 第69行: | ||
==实现== | ==实现== | ||
+ | [[文件:FStarLang-logo.png|right|F*]] | ||
[[文件:Alpaca-language.png|right|Alpaca]] | [[文件:Alpaca-language.png|right|Alpaca]] | ||
第46行: | 第77行: | ||
*[[OCaml]],ML的一种方言,支持面向对象编程。 | *[[OCaml]],ML的一种方言,支持面向对象编程。 | ||
*[[F Sharp|F#]],[[.NET]]框架的ML实现。 | *[[F Sharp|F#]],[[.NET]]框架的ML实现。 | ||
− | *[[F*]] | + | *[[F*]] A Proof-oriented Programming Language |
*[[isabelle]] | *[[isabelle]] | ||
*[https://github.com/mth/yeti Yeti] is ML style functional programming language, that runs on the [[JVM]]. | *[https://github.com/mth/yeti Yeti] is ML style functional programming language, that runs on the [[JVM]]. | ||
− | *[https://github.com/CakeML/ CakeML] | + | *[https://cakeml.org/ CakeML] A Verified Implementation of ML, [https://github.com/CakeML/cakeml/blob/master/basis/types.txt CakeML Types] |
*[https://github.com/alpaca-lang Alpaca] Functional programming inspired by ML for the [[Erlang VM]] | *[https://github.com/alpaca-lang Alpaca] Functional programming inspired by ML for the [[Erlang VM]] | ||
*[https://futhark-lang.org/ Futhark] is a purely functional data-parallel programming language in the ML family, Written in [[Haskell]]. | *[https://futhark-lang.org/ Futhark] is a purely functional data-parallel programming language in the ML family, Written in [[Haskell]]. | ||
第65行: | 第96行: | ||
==文档== | ==文档== | ||
*[https://www.cs.cmu.edu/~rwh/isml/book.pdf Programming in Standard ML] | *[https://www.cs.cmu.edu/~rwh/isml/book.pdf Programming in Standard ML] | ||
+ | *[https://smlfamily.github.io/papers/Appel-critique-SML.pdf A Critique of Standard ML] | ||
+ | *[https://smlfamily.github.io/papers/MacQueen-reflections.pdf Reflections on Standard ML] | ||
+ | *[https://homepages.inf.ed.ac.uk/stg/NOTES/ Programming in Standard ML'97: An On-line Tutorial] [https://homepages.inf.ed.ac.uk/stg/NOTES/notes.pdf PDF File] | ||
+ | |||
+ | ==图书== | ||
+ | *[https://www.cs.princeton.edu/~appel/modern/ml/ 《Modern Compiler Implementation in ML》] Andrew W. Appel | ||
==图集== | ==图集== | ||
<gallery> | <gallery> | ||
+ | image:ML-programming.png|ML语言家族 | ||
image:HOL4-Emacs.png|HOL4 Emacs | image:HOL4-Emacs.png|HOL4 Emacs | ||
+ | image:CakeML-Ecosystem.png|CakeML | ||
+ | image:cakeml-verified-x86-64-machine-code.png|CakeML验证x86-64机器码 | ||
+ | image:HOL-family-tree.png|HOL家族 | ||
+ | image:ITP-Common-Terms-and-Types.png|常见Terms和Types | ||
+ | image:Verified-vs-Verifying-Program.png|Verified vs. Verifying Program | ||
+ | image:PolyML-SML-Basis-Library.png|Poly/ML源码对照SML标准库 | ||
</gallery> | </gallery> | ||
第81行: | 第125行: | ||
[[category:F Sharp]] | [[category:F Sharp]] | ||
[[category:OCaml]] | [[category:OCaml]] | ||
+ | [[category:formal]] | ||
[[category:proof assistant]] | [[category:proof assistant]] | ||
+ | [[category:reasoning]] | ||
[[category:lambda]] | [[category:lambda]] | ||
[[category:Huihoo Foundation]] | [[category:Huihoo Foundation]] |
2024年9月7日 (六) 15:13的最后版本
您可以在Wikipedia上了解到此条目的英文信息 ML Thanks, Wikipedia. |
ML 编程语言
目录 |
[编辑] 简介
ML 是一个通用的函数式编程语言,它是由爱丁堡大学的 Robin Milner 及他人在二十世纪七十年代晚期开发的。它的语法是从 ISWIM 得到的灵感。作为元语言的ML是为了帮助在 LCF 定理证明机中寻找证明策略而构想出来的。(之前的元语言是 pplambda,它联合了一阶逻辑演算和有类型的多态的λ演算)。它使用了 Hindley-Milner 类型推论算法来推测大多数值的类型,而不需要四处使用注解。
- History of Standard ML The History of Standard ML 2020版
- The History of Standard ML: Ideas, Principles, Culture The History of Standard ML
[编辑] ML & Lisp
Lisp was the language in which the Stanford LCF system was implemented and also served as its “meta-language.” The design of ML for Edinburgh LCF was informed by Milner’s experience at Stanford; in fact, LCF/ML was implemented by translation into Stanford Lisp code.《The History of Standard ML 2020版》86:7
Lisp 是实现斯坦福 LCF 系统的语言,同时也是其"元语言"。为爱丁堡 LCF 设计的 ML 是由 Milner 在斯坦福大学的经验提供的。事实上,LCF/ML 是通过翻译成斯坦福 Lisp 代码实现的。
[编辑] 功能
ML一般被归为非纯函数式编程语言,因为它允许副作用和指令式编程。这一点和纯函数式编程语言,例如Haskell很不一样。
ML特性包括:传值呼叫(Call by value)的求值策略,一级函数,带有垃圾收集的自动内存管理,参数多态,静态数据类型,类型推论,代数数据类型,模式匹配和异常处理。
不像Haskell,ML使用及早求值,也就是说所有的子表达式总是被求值。导致的一个结果是你不能使用无穷表。然而,惰性求值产生的无穷表可以通过使用匿名函数来模拟。
今天在ML家族中有好几种语言:两种主要的方言是Standard ML和 OCaml,其他的包括F#-针对Microsoft .NET平台的开放研究项目。ML中的思想影响了众多的语言,例如Haskell,Cyclone和Nemerle。
ML的实力大多被用于语言设计和操作(编译器构建、自动化定理证明和形式化验证),但是它作为通用语言也被用于生化,金融系统,和宗谱数据库,一个P2P的客户/服务器程序等等。
Standard ML provides modules [called `structures'] with interfaces [called `signatures'].
[编辑] 标准
- Successor ML 是用来描述ML语言的下一个版本的术语
- SML97 The Standard ML Basis Library Standard ML Grammar of SML97
- SML90
- ML2000
- Syntax of the Core
Reserved Words
abstype and andalso as case datatype do else end exception fn fun handle if in infix infixr let local nonfix of op open orelse raise rec then type val with withtype while ( ) [ ] { } , : ; ... _ | = => -> #
- Syntax of Modules
Reserved Words
eqtype functor include sharing sig signature struct structure where :>
- Static Semantics for the Core(49 Inference Rules 推理规则)
- Static Semantics for Modules (50-89,40 Inference Rules)
- Dynamic Semantics for the Core(90-149,60 Inference Rules)
- Dynamic Semantics for Modules(150-186,37 Inference Rules)
- Programs(187-189,3 Inference Rules)
[编辑] 指南
Programming in Standard ML '97: An On-line Tutorial
很多 SML 实现提供交互式REPL,比如 SML/NJ
Debian
$ sudo apt install smlnj $ sml Standard ML of New Jersey v110.79 [built: Tue Aug 8 16:57:33 2017] - 1 + 2 * 3; val it = 7 : int
[编辑] 实现
ML 家族的两个主要的方言是 Standard ML 和 OCaml。ML 的实力大多被用于语言设计和操作,比如建构编译器、分析器、定理证明器。ML 确立了静态类型函数式编程范型,从而在编程语言历史上占有显要地位,它的思想在影响了众多的语言,例如:Haskell、Nemerle ATS 和 Elm。
- Standard ML 是 ML 的现代方言,ML 是用于 LCF(可计算函数逻辑)定理证明计划的编程语言。Standard ML 在广泛使用的语言之中与众不同,源于它具有正式规定《The Definition of Standard ML》 给出了语言的类型规则和操作语义
- OCaml,ML的一种方言,支持面向对象编程。
- F#,.NET框架的ML实现。
- F* A Proof-oriented Programming Language
- isabelle
- Yeti is ML style functional programming language, that runs on the JVM.
- CakeML A Verified Implementation of ML, CakeML Types
- Alpaca Functional programming inspired by ML for the Erlang VM
- Futhark is a purely functional data-parallel programming language in the ML family, Written in Haskell.
- Standard ML of New Jersey
- MLKit The Standard ML Compiler and Toolkit
- MLton
- Poly/ML
- The Free Poplog Portal Poplog Standard ML
[编辑] 项目
[编辑] 文档
- Programming in Standard ML
- A Critique of Standard ML
- Reflections on Standard ML
- Programming in Standard ML'97: An On-line Tutorial PDF File
[编辑] 图书
- 《Modern Compiler Implementation in ML》 Andrew W. Appel