Live data from Hacker News

OCaml Programming: Correct and Efficient and Beautiful

cs3110.github.io

1–10 of 60 posts

Re: OCaml Programming: Correct and Efficient and Beautiful

#4
Could an OCaml expert give a quick take on the view that if FP, why not go all the way and do Haskell instead? I mean, if "correct, efficient, beautiful" are attributes of OCaml (and I know opinions differ, but let's assume for a moment..) then shouldn't they be attributes of Haskell too, maybe even more so in some ways?

Re: OCaml Programming: Correct and Efficient and Beautiful

#8
post #4

Could an OCaml expert give a quick take on the view that if FP, why not go all the way and do Haskell instead? I mean, if "correct, efficient, beautiful" are attributes of OCaml (and I know opinions differ, but let's assume for a moment..) then shouldn't they be attributes of Haskell too, maybe even more so in some ways?

I'm not an OCaml or Haskell expert, but I expect that laziness makes performance harder to reason about?

Edit: but in this case, apparently the book was written for a course at Cornell where they teach both functional and imperative programming using the same language.

Re: OCaml Programming: Correct and Efficient and Beautiful

#9
Apart from being tied with Jane Street's libraries, Real World OCaml is "deeper" in that it also talks about implementation details. This book has a more "introduction to functional programming via OCaml" vibe. Both are good textbooks with different emphases.

The main author Michael Clarkson also started a similar lecture series on Software Foundations using Rocq (Coq)[1]. Not sure if that's still updated though.

[1]: https://github.com/clarksmr/sf-lectures

Re: OCaml Programming: Correct and Efficient and Beautiful

#10
post #4

Could an OCaml expert give a quick take on the view that if FP, why not go all the way and do Haskell instead? I mean, if "correct, efficient, beautiful" are attributes of OCaml (and I know opinions differ, but let's assume for a moment..) then shouldn't they be attributes of Haskell too, maybe even more so in some ways?

At least theoretically they could be however OCaml is in large part driven by Jane Street and has been for some time now and Jane Street's entire business model is built around optimizing for ultra high throughput, ultra low latency software where mistakes could cost on the order of hundreds of billions of dollars.

So my guess would be less that Haskell is not these things (nor couldn't it be) but rather that OCaml has had the external forces necessary to optimise for these things above all else.

Post reply on HN