Live data from Hacker News

My thoughts on OCaml

osa1.net

91–100 of 230 posts

Re: My thoughts on OCaml

#91

Earlier quoted context omitted.

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…

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#.

Re: My thoughts on OCaml

#92
post #83

Earlier quoted context omitted.

So are you saying that Jane Street more or less bribed people who didn't really care for OCaml to come work in a weird language, by offering a good salary? I find that far-fetched, and there are many other examples of companies attractive highly-competent people because they choose -- no, not exotic, weird, or niche tech, but good tech, that aid people thinking more clearly and abstracting better. As in everything el…

"Bribed" is a crude way to describe it, but in a manner of speaking, yes? I think you might be a tad idealistic, and you might think I'm being a tad cynical. Maybe the truth is in the middle somewhere. But throwing enough money at someone can talk. And not throwing enough money at someone can also talk. Short of being asked to do something unethical or illegal, what's wrong with that? Can you honestly say all of the…

Ron Minsky of Jane Street has explicitly said, many times, that their choice of OCaml attracted great developers who wanted to work with it.

Re: My thoughts on OCaml

#93
The biggest problem I have with Ocaml is not the language, but the tooling and the libraries. The library ecosystem is not even remotely comparable to go or even rust. Jane street core is mentioned as a good option, but that library is the most popular undocumented library I have ever seen. There is not even some normal default structure every library follows (e.g go io.Reader).

Compare this to languages with supposedly "worse" type systems like Java, which has a library for everything and high quality well documented libraries like guava and apache commons. I find it fine to use ocaml for a random weekend whim project, but wouldn't touch it with a 10 feet pole for professional work.

Re: My thoughts on OCaml

#94
post #83

Earlier quoted context omitted.

So are you saying that Jane Street more or less bribed people who didn't really care for OCaml to come work in a weird language, by offering a good salary? I find that far-fetched, and there are many other examples of companies attractive highly-competent people because they choose -- no, not exotic, weird, or niche tech, but good tech, that aid people thinking more clearly and abstracting better. As in everything el…

"Bribed" is a crude way to describe it, but in a manner of speaking, yes? I think you might be a tad idealistic, and you might think I'm being a tad cynical. Maybe the truth is in the middle somewhere. But throwing enough money at someone can talk. And not throwing enough money at someone can also talk. Short of being asked to do something unethical or illegal, what's wrong with that? Can you honestly say all of the…

> I think you might be a tad idealistic

Agreed :)

Re: My thoughts on OCaml

#95
post #28
post #8

[flagged]

The author is plenty aware of them, I can assure you (I used to work with him on the Glasgow Haskell Compiler; most Haskell programmers are plenty familiar with the ML module system, it's a highly coveted feature by many.) Anyway, what they're referring to has been rehashed a billion times already in the relevant communities. ML functors being good has little to do with it; even with functors and modules, you're requ…

Great comment. Thanks!

Re: My thoughts on OCaml

#96
post #28
post #8

[flagged]

The author is plenty aware of them, I can assure you (I used to work with him on the Glasgow Haskell Compiler; most Haskell programmers are plenty familiar with the ML module system, it's a highly coveted feature by many.) Anyway, what they're referring to has been rehashed a billion times already in the relevant communities. ML functors being good has little to do with it; even with functors and modules, you're requ…

When writing about a language which has a well-known feature called 'interfaces', it behooves the writer to not use 'interfaces' to mean 'ad-hoc polymorphism' to avoid confusion. Not doing so led to the predictable confusion.

Re: My thoughts on OCaml

#97

The biggest problem I have with Ocaml is not the language, but the tooling and the libraries. The library ecosystem is not even remotely comparable to go or even rust. Jane street core is mentioned as a good option, but that library is the most popular undocumented library I have ever seen. There is not even some normal default structure every library follows (e.g go io.Reader). Compare this to languages with suppose…

It is for these (tooling / library) reasons it is almost impossible to recommend it for any project, almost like Nix in that regard for me.

Re: My thoughts on OCaml

#100

I used OCaml as my daily driver in grad school and my postdoc, and recommend my students use it. I think the main benefits of OCaml are: Functional Has mutable references Not lazy Haskell's type system is just better. But for large, complex systems that require performant code, it can be quite difficult to track the laziness, and sometimes life is just easier if I can use a mutable references. The author is completel…

Starting with F# on Mac is worlds away from what it was in the past, I bet you could be up and running in 5 minutes:

  brew install dotnet-sdk
  dotnet new console -lang F# (in your project directory)
Start VS Code in that directory, install ionide via extensions, write code…

  dotnet run
Post reply on HN