TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Comparing OCaml and Standard ML

103 pointsby carloscmover 10 years ago

8 comments

sgeisenhover 10 years ago
Purity is almost used in a pejorative sense throughout the page.<p>If it wasn&#x27;t for poor library support, I would prefer using SML to OCaml. SML is syntactically simpler and both SML&#x2F;NJ and MLton have a lot to offer that I haven&#x27;t yet found with OCaml.<p>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 &quot;Successor ML&quot; (see: <a href="http://sml-family.org/" rel="nofollow">http:&#x2F;&#x2F;sml-family.org&#x2F;</a>), but I honestly don&#x27;t see it catching on outside of an academic space.<p>As an academic language, SML is great. It is a great tool for learning functional programming since the learning curve isn&#x27;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.
评论 #8498400 未加载
评论 #8499091 未加载
评论 #8499795 未加载
评论 #8497415 未加载
评论 #8500299 未加载
a0over 10 years ago
ML&#x27;s syntax is indeed less confusing than OCaml&#x27;s. And that&#x27;s the reason I&#x27;m working on a compiler front-end replacement for OCaml inspired by Clojure, Haskell, Ruby and Julia. It will be for OCaml what Elixir is for Erlang. I&#x27;m finishing the parser right now and will next implement the language primitives as a library in the language itself.
评论 #8497729 未加载
评论 #8497632 未加载
p4bl0over 10 years ago
Small update: recent versions of OCaml have immutable strings too.<p>It also miss mention of package manager (OCaml has Opam, which is awesome, I don&#x27;t know about SML).<p>And ocamlbuild is missing from the build tools section.
评论 #8497512 未加载
评论 #8498111 未加载
CmonDevover 10 years ago
Wow, ML syntax is actually better than OCaml. It&#x27;s a shame the former was used as a base for F#.
评论 #8497758 未加载
评论 #8499932 未加载
评论 #8497653 未加载
gnudover 10 years ago
I really enjoy working with SML (I&#x27;ve used sml&#x2F;nj and parrotml) - and would love to use it for &quot;real&quot; projects, but until it actually has decent unicode support, there&#x27;s just no way I can.
zvrbaover 10 years ago
Ocaml: the practical and the ugly one. (I hate Ocaml&#x27;s syntax mainly due to the noise of let ... in clauses)
Altenuvianover 10 years ago
including mythryl, a sml&#x2F;nj derivative with c-flavored syntax to the comparison would be interesting. see <a href="http://mythryl.org/" rel="nofollow">http:&#x2F;&#x2F;mythryl.org&#x2F;</a> for further info.
评论 #8502726 未加载
agumonkeyover 10 years ago
Sml syntax is indeed very nice, and emacs sml-mode is pretty strong too. A great joy to use, almost as good as paredit.