Hacker News new | ask | show | jobs
by Miltnoid 1151 days ago
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 completely correct that there's a big failure in the lack of a type-class-like system. This is why people ask so much for modular implicits. Core is also a decent standard library (though I don't know why they require sexp_of_t and t_of_sexp on like all their data structures).

So I'd gladly use a different functional language with mutable references and strict evaluation. But there isn't any besides F#, and I have a Mac and don't personally want to figure out .NET on Mac.

4 comments

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
Exactly. And you can even pick between 3 IDEs

- JetBrains Rider (best IMHO)

- Visual Studio for Mac

- VS Code with Ionide

Sublime text too with the fsautocomplete LSP server.
They require `sexp_of_t` and `t_of_sexp` because of their workflow being based on them; such as expectation testing [1] and tools such as [2]. It's a less noisy alternative to json for many people.

[1] https://blog.janestreet.com/testing-with-expectations/ [2] https://github.com/janestreet/sexp

I think looking at it as a 'failure' or 'deficiency' is the wrong mindset. OCaml makes a different tradeoff than Haskell. In exchange for not having ad-hoc polymorphism, OCaml's functor system allows much quicker compilation and easier-to-understand type errors. Like everything in tech, it's a tradeoff.
What about StandardML?