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

I like OCaml, but if I were to start a new project with an ML I'd probably lean towards F# to take advantage of all the .NET libs


We use F# in prod. Could not be happier.


Completely ignorant here:

- I really want to do a project in an almost "pure" functional language. I tried with Elixir and Phoenix, and while they are certainly great, and I wouldn't mind using it again, Elixir, and subsequently Erlang didn't feel like FP a lot of times, it felt like the warty Elixir/Erlang way to do FP, so it didn't scratch that itch for me (but again, still a great experience overall)

- is there a way to do this openly? I.E. with dotnetcore, running on linux containers, no windows what so ever, etc? Guessing yes but wanted to make sure from people who have actually done it

- What exactly about the .NET libraries that has everyone so hyped up about? I remember from my C# .NET days, they always felt to be lacking.


Today you can install the .NET runtime, as well as the .NET development tools, on both Windows and Linux. They handle F# as well as C# out of the box.

You can `dotnet publish MyApp.fsproj` on either Windows or Linux, copy the resulting `publish/` folder to another machine with a different OS, and use `dotnet MyApp.dll` to run it. There are also ways to create containers, though I have never tried them for lack of an actual use case.

As for libraries, .NET comes with a huge standard library, much larger than what you would find on a different language. Off the top of my head, here are a few things that come with .NET that would have been a third party library in other languages: text encodings, protocols (HTTP client, TLS, QUIC, SMTP), mainstream hashes (MD5/SHA1/SHA256), mainstream crypto (AES/DES/RSA/EC/ChaCha), serialization (JSON/ XML), weird formats (X509/ASN.1/tar/MIME), mainstream compression (deflate/brotli/zip), binary data manipulation (e.g. endianness conversion, AVX intrinsics, memory-mapping), runtime code generation, in-assembly resources, interoperability (COM, JavaScript, Objective C, SQL), concurrent collections, async...

Besides, since C# is popular, many tools have .NET-compatible clients or libraries which can then be accessed from F#.


+ macOS


Scala might be a good option - the JVM library ecosystem is second to none, Linux is very much first class and ~everything is open source. Although you may have the same problem of not being forced into a pure style.

(I think learning Standard ML first was very good for my programming practices, but I wouldn't suggest it for real projects)


Lacking what? .Net is the kitchen sink.


Lacking in quality.


Are you kidding? .Net is ridiculously well designed.


You asked me to clarify what I felt they were lacking. I was pretty explicit about the fact that this was my opinion based upon my previous experience working at .NET shops and using C#. So no, I am not kidding.

What in your opinion makes .NET so well designed?


Same, big fan of f#.




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

Search: