Re:Comparing OCaml and Standard ML
by CmonDev on Thursday October 23, 2014 @06:29AM
(#8497472)
Wow, ML syntax is actually better than OCaml. It's a shame the former was used as a base for F#.
[ Parent
| on HN ]
One thing I think F# got right is that it removed some of the "flexibility" in OCaml's syntax. For example, it uses significant whitespace to define scoping, which removed (in nearly all cases) the need for the 'in' keyword and lots of parentheses and semicolons. That may not sound like a huge deal, but it does greatly improve the readability of F# code (all other things being equal).
> One thing I think F# got right is that it removed some of the "flexibility" in OCaml's syntax. For example, it uses significant whitespace to define scoping, which removed (in nearly all cases) the need for the 'in' keyword and lots of parentheses and semicolons. That may not sound like a huge deal, but it does greatly improve the readability of F# code (all other things being equal).
I must disagree. I once translated a significant (15kLOC) commercial OCaml code base into F# and took the opportunity to quantify the syntactic benefits as <3% by volume of code. The flipside is that F# misinterprets code pasted from the web, rendering most code on the web useless. That is a crippling deficiency of F# in my eyes and a major reason to go back to the superior OCaml solution.
Actually when F# was introduced, you could switch between both modes.
After voting the #light "on" became the default behaviour.
You can get the more compatible OCaml one with #light "off".
> Wow, ML syntax is actually better than OCaml. It's a shame the former was used as a base for F#.
I prefer this:
http://www.ffconsultancy.com/languages/ray_tracer/code/1/ray...
to this:
http://www.ffconsultancy.com/languages/ray_tracer/code/1/ray...