Live data from Hacker News

Why I love OCaml (2023)

mccd.space

21–30 of 313 posts

Re: Why I love OCaml (2023)

#21
post #17

Yes, in every ML/OCaml tutorial, sooner or later the words object, class, and type inference appear and that’s when a once–minimalist language turns into an academic Frankenstein.

I don't think objects and classes are used much by OCaml programmers (not by me anyway). Type inference is a rather fundamental feature, and fairly easy to understand.

Re: Why I love OCaml (2023)

#24
I've dabbled in F# (and aside from the rough setup with little coherent information at the time) had a pretty good time. Actor-based concurrency was easy to grok. The one gotcha was whenever those mutable Arrays entered the picture.

I'd like to hear some practical reasons for preferring OCaml over F#. [Hoping I don't get a lot about MS & .NET which are valid concerns but not what I'm curious about.] I want to know more about day to day usage pros/cons.

Re: Why I love OCaml (2023)

#25
post #4
post #2

OCaml has been one of those "almost there" languages since at least 2002. Most of the worthwhile ideas in OCaml will be absorbed into more popular languages by the time existing friction is sorted out. :/

Almost there, but in the meantime supporting a casual squillion dollars of trades at JS

Yes and they had to basically build their own version of the compiler to keep everything from falling over (https://oxcaml.org/).

Re: Why I love OCaml (2023)

#26

Earlier quoted context omitted.

Perhaps OCaml is the Velvet Underground of languages. Only a few thousand people learned OCaml but every one made a programming language[1] [1]: https://quoteinvestigator.com/2016/03/01/velvet/

That would be Elm :)

Roc says hi!

Re: Why I love OCaml (2023)

#27

I've dabbled in F# (and aside from the rough setup with little coherent information at the time) had a pretty good time. Actor-based concurrency was easy to grok. The one gotcha was whenever those mutable Arrays entered the picture. I'd like to hear some practical reasons for preferring OCaml over F#. [Hoping I don't get a lot about MS & .NET which are valid concerns but not what I'm curious about.] I want to know mo…

> I'd like to hear some practical reasons for preferring OCaml over F#

Bigger native ecosystem. C#/.net integration is a double edged sword: a lot of libraries, but the libraries are not written in canonical F#.

A lot of language features F# misses, like effect handlers, modules, GADTs etc.

Re: Why I love OCaml (2023)

#28
post #7

To this day, whenever I see Machine Learning abbreviated, my heart skips a beat, then I become crestfallen as I realize I'm not about to read something about Meta Language.

ML blew my mind back in the late 1980s when I got to use it on a 80286 machine for the first time!

Re: Why I love OCaml (2023)

#30

For something a bit more modern but still related to OCaml, one can try F#.

F# is a practical choice but the language features are quite far behind OCaml now. {Ecosystem, Functors} - choose 1

From an outsider's perspective, it feels like Ocaml has more active development of features, between the new effects system they added in 5 and all the work Janestreet is doing to let Ocaml developers have more control over performance.

F# is not stagnant thankfully, it gets updates with each new version of dotnet (though I haven't checked what is coming with dotnet 10), but I don't recall anything on the level of the above Ocaml changes in years.

Post reply on HN