4 ms·
Disclaimer: I have more exposure to F#, and am very early in OCaml journey. They are similar because F# pretty much completely borrowed the OCaml syntax when i
by lf-non 4y ago
Disclaimer: I have more exposure to F#, and am very early in OCaml journey.
They are similar because F# pretty much completely borrowed the OCaml syntax when it was created. There have been many syntactic enhancements since and F# that most people write nowadays (the light syntax) is a quite bit different from OCaml though they remain similar.
The bigger differences are around the type system & modules. The F# team doesn't seem to have enough power to sway the direction of CLR, so OCaml features that didn't cleanly map to C# constructs or hinder interop with other dotnet languages (like parameterized modules, structural typing etc.) were not adopted in F#.
Also from my early exploration OCaml binaries seem to be a lot smaller and the compiler a lot faster.
This is not a criticism of F#, I have found that the combination of lightweight syntax, computation expression syntax, access to both dotnet and javascript ecosystems (fable) and the great tooling (ionide) to result in a very productive experience for day to day work, though FP enthusiasts tend to scoff at lack of higher level abstractions. Looking forward to exploring OCaml more over the next few months.