Live data from Hacker News

Comparing OCaml and Standard ML

adam.chlipala.net

1–10 of 71 posts

Re: Comparing OCaml and Standard ML

#2
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.

Re: Comparing OCaml and Standard ML

#3
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.

Re: Comparing OCaml and Standard ML

#5
post #2

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.…

I really liked SML and wanted to use it in anger after reading "ML for the working programmer" and "Purely functional data structures" (excellent functional programming books by the way) but just couldn't due to the lack of libraries as you say. For me the object system on Ocaml was just too much. Tis a pity.

Re: Comparing OCaml and Standard ML

#7
post #3

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.

Out of curiosity, why do you think Opam is awesome? I recently had to install a few OCaml projects and I had a hard time dealing with opam and ocamlfind (both on mac os and a linux VM). I suppose it's fine once everything is properly set up.

I have the impression that the OCaml world has seen a lot of changes recently with a lot of complexity added.

Re: Comparing OCaml and Standard ML

#8
ML's syntax is indeed less confusing than OCaml's. And that's the reason I'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'm finishing the parser right now and will next implement the language primitives as a library in the language itself.

Re: Comparing OCaml and Standard ML

#9
I really enjoy working with SML (I've used sml/nj and parrotml) - and would love to use it for "real" projects, but until it actually has decent unicode support, there's just no way I can.

Re: Comparing OCaml and Standard ML

#10
post #2

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.…

I really liked SML and wanted to use it in anger after reading "ML for the working programmer" and "Purely functional data structures" (excellent functional programming books by the way) but just couldn't due to the lack of libraries as you say. For me the object system on Ocaml was just too much. Tis a pity.

> For me the object system on Ocaml was just too much

What do you mean by that ? The current consensus about the object system in OCaml is "don't use it", even if there might be cases where it will describe your system better.

The standard library (both the real stdlib and Jane Street's Core library) don't use objects so you can pretty much ignore this part of the language if you want to.

Post reply on HN