News for hackers. Stuff that matters.
Re:My Thoughts on OCaml by nu11ptr on Tuesday April 25, 2023 @09:44AM (#35700367)
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
Re:My Thoughts on OCaml by JaggerJo on Tuesday April 25, 2023 @10:02AM (#35700630)
We use F# in prod. Could not be happier.
Re:My Thoughts on OCaml by dimitrios1 on Tuesday April 25, 2023 @11:57AM (#35702252)
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.

Re:My Thoughts on OCaml by victorNicollet on Tuesday April 25, 2023 @12:40PM (#35702950)
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...

Re:My Thoughts on OCaml by JaggerJo on Tuesday April 25, 2023 @01:52PM (#35704137)
+ macOS
Re:My Thoughts on OCaml by bottlepalm on Tuesday April 25, 2023 @07:04PM (#35707896)
Lacking what? .Net is the kitchen sink.
Re:My Thoughts on OCaml by dimitrios1 on Thursday April 27, 2023 @12:08PM (#35730217)
Lacking in quality.
Re:My Thoughts on OCaml by bottlepalm on Monday May 01, 2023 @02:48PM (#35777312)
Are you kidding? .Net is ridiculously well designed.
Re:My Thoughts on OCaml by dimitrios1 on Thursday May 04, 2023 @04:03PM (#35821306)
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?

Re:My Thoughts on OCaml by lmm on Tuesday April 25, 2023 @07:06PM (#35707914)
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)

Re:My Thoughts on OCaml by lysecret on Tuesday April 25, 2023 @10:50AM (#35701271)
Same, big fan of f#.