DEV Community


Discussion on: F# is Pretty Cool

lyfolos profile image
Muhammed H. Alkan • Edited

If you want a better performance, easier JS interop (than Fable) you have to use OCaml. F# was "OCaml for .NET" before, and it's still interoptable with OCaml. They classified OCaml, for example ;; is optional ; is can be replaced with \n (Newline), foreach loop added for ... in ... so on. You can still use the OCaml syntax, using verbose syntax (It's still part of F# Grammar and Parser, it's not a new language). In my opinion, learning OCaml before learning F# will be more useful for you.

deciduously profile image
Ben Lovy Author • Edited

I did learn OCaml before I learned F# - and strongly prefer the latter. Thanks for the tip, though!

I agree, JS interop via BuckleScript is really nice, but everything else was harder to use than the equivalent in F#

lyfolos profile image
Muhammed H. Alkan

Ah, I just remembered it now. There is OCaml preprocessor or macro language named camlp. That makes you easier to code OCaml, makes you have more features like F# have. For example for each loop

let a_list = ["hello"; "world"] in
for s in a_list do
  print_endline s