Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

F# doesn't have functors but SML and OCaml do. F# has Computation Expressions which (AFAIK) SML does not have; OCaml has PPX extensions. F# has access to .NET ecosstem, JS ecosystem and multi-core. OCaml has easy binding to C but multi-core hasn't quite landed yet. There are a few competing JS compilers for OCaml.

F# is the most mainstream of the 3. If you can live without the fancier type-system features (trust me, you probably can!) it's the easiest ride.



F# has quite a bit of awkwardness related to dotnet compatibility.

In practice you have to use a lot of C# class based code, which brings an inherent mismatch to the functional model and makes code look more like a multi-paradigm language like Scala.

The tooling and ecosystem is great (though not as good as for C#, obviously...), the language has some very nice features and design decisions, but you have to live with a somewhat messy reality.

In practice sticking to C# is probably wiser.


I think a little bit of OOP-related messiness is easily worth it to be part of a mainstream ecosystem.


An interesting opinion on OOP in F# from Eirik Tsarpalis, who curiously started out their programming with pure FP in Haskell [1].

And a talk from Don Syme, the author of F#, on good F# code as they see it [2]. It's a great talk overall and they specifically address OOP's good and bad bits starting from about 39:00.

1: https://eiriktsarpalis.wordpress.com/2017/03/20/why-oo-matte...

2: https://www.youtube.com/watch?v=1AZA1zoP-II


> The tooling and ecosystem is great

When I (an utter beginner in it) code in F#, I miss ReSharper a lot. I wish there were an IDE extension with features similar that of ReSharper but for F# rather than C#.


Give Rider[1] a try? Its F# support is not as fully-featured as C#, but its, in my opinion, the best available F# IDE. Worth noting, many great features of Rider aren't C#-specific, e.g. the incremental search in files works for any language. Keep in mind, it's not free though.

1: https://www.jetbrains.com/rider/


I can recommend getting an all products pack for personal use, if you can afford it.


Many programmers will tell you that you can live with no type system at all, and they would be correct.

Personally, as an Ocaml coder, I make extensive use of Ocaml's fancier type-system features and would be sad to lose them.


> If you can live without the fancier type-system features

One could argue that not only you can, but you should (for the sake of having more readable programs).


Anther way to put it - F# has a .NET dependency :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: