Hacker News new | ask | show | jobs
by CmonDev 4256 days ago
Wow, ML syntax is actually better than OCaml. It's a shame the former was used as a base for F#.
3 comments

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

Really? I can see how it's nicer in some places, but you'll take currying and or patterns out of my cold, dead hands (and there are some cases where you do need objects).