编程与软件工程adam.chlipala.net
OCaml 与 Standard ML 比较
Comparing OCaml and Standard ML
2012 — 2024,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是 Adam Chlipala 撰写的 OCaml 与 Standard ML (SML) 两种 ML 家族语言的详细对比页面,涵盖语法、类型系统、字符串可变性、构建工具等多个方面。文章多次登上 HN 首页,是了解这两种语言差异的经典参考资料。
为什么经久不衰:ML 家族语言的对比资料稀少,这篇由知名学者撰写的对比在十余年间反复被引用,至今仍是选择或学习这两种语言时的重要参考。
HN 评论精选
SML 语法更优但过早标准化导致停滞,作为学习函数式编程的语言很出色
页面上'纯度'一词几乎是以贬义使用的。如果不是库支持太差,我更愿意用 SML 而不是 OCaml。SML 语法更简洁,SML/NJ 和 MLton 都有很多 OCaml 没有的优点。我认为 SML 生命周期中最大的错误之一是过早标准化,导致语言停滞了近 20 年。现在有 'Successor ML' 的提法,但我不认为它能在学术界之外流行起来。作为学术语言,SML 很棒:学习曲线不陡,适合学函数式编程;求值顺序显式,容易推理性能;不可变是默认但可变类型也易用。
sgeisenh查看英文原文
Purity is almost used in a pejorative sense throughout the page. If it wasn't for poor library support, I would prefer using SML to OCaml. SML is syntactically simpler and both SML/NJ and MLton have a lot to offer that I haven't yet found with OCaml. I think one of the biggest mistakes in the life cycle of SML was premature specification. As a result of the language definition, SML has stagnated for almost 20 years. There is now some notion of "Successor ML" (see: http://sml-family.org/), but I honestly don't see it catching on outside of an academic space. As an academic language, SML is great. It is a great tool for learning functional programming since the learning curve isn't especially steep. It is easy to reason about performance since evaluation order is explicit. And immutability is the default but with mutable types that are easy to use.
文章部分内容已过时,OCaml 近年改进显著
小更新:新版 OCaml 的字符串也是不可变的了。文章还漏了包管理器(OCaml 有很棒的 Opam,不知道 SML 有没有),构建工具部分也漏了 ocamlbuild。
p4bl0查看英文原文
Small update: recent versions of OCaml have immutable strings too. It also miss mention of package manager (OCaml has Opam, which is awesome, I don't know about SML). And ocamlbuild is missing from the build tools section.
认为 ML 语法优于 OCaml,为 F# 基于 OCaml 而惋惜
哇,ML 的语法确实比 OCaml 好。可惜 F# 是以前者为(OCaml)基础设计的。
CmonDev查看英文原文
Wow, ML syntax is actually better than OCaml. It's a shame the former was used as a base for F#.
指出对比遗漏了多线程与并行这一重要维度
完全没提多线程和并行处理?如果是在比较语言,这似乎是个重大遗漏。
beering查看英文原文
Nothing said about multithreading and parallel processing? Seems like a big omission if you're comparing languages.
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选