Heavily outdated OCaml on Homebrew

I personally rarely use OCaml from package managers, but recently had to quickly install ocaml on a new Mac - and this is what I saw:

Out of curiosity, why not use opam?

I can’t speak for others, but generally I prefer to use as few package managers as possible. So, I install pretty much everything through brew on macOs, through apt on Ubuntu, and through winget on Windows, for example. This way there is a single tool through which I can manage (list, upgrade, uninstall, configure, …) what I have installed. Of course, not everything can be installed through those tools and it is always an extra hurdle: I have to go and read the manuals of some snowflake tool, make sure that it is actually a safe tool to use, … I’d rather not. I suspect in the future I will be using more and more virtualization (which I do all the time already) to avoid installing stuff directly on my machines.

1 Like

I prefer to use opam to manage the various versions of OCaml rather than Homebrew, pacman, apt or other system package managers.

There’s another advantage of using 4.14 instead of 4.12: Applications built using OCaml in Homebrew can use 4.14 features and don’t need to support 4.12 as minimum version (or bring their own compiler, which is a hassle).

We should aim for distributions to ship recent versions of the OCaml compiler, as that makes the job of application writers easier since they can stop supporting older versions faster (e.g. stopping to support versions older than 4.08 allows to use the let* syntax).

I’m not saying distros shouldn’t ship recent OCaml versions (roughly speaking, Homebrew can be considered a ‘distro’ in a sense); but isn’t this an old and common problem of distro packagers not really being incentivized to keep up with upstream updates? They are usually looking for stability, not to continuously test for upstream breakage. They’re typically dealing with not just OCaml but other ecosystems of libraries and applications, so OCaml people are not really in a position to demand special treatment.

I think we’re on the same page. Homebrew, as most distros is volunteer-driven (and given the development is on Github via PRs it is more accessible to spontaneous contributors than, say, Debian) so I don’t think they prioritize or deprioritize the version of the OCaml compiler specifically - it is whatever people contribute, which is somewhat linked to the popularity of the package (and secondly to how forward compatible it is, that is not introducing additional breakage to the distribution).

Maybe it would make sense to keep in touch with distro maintainers to get OCaml releases included into distributions quicker. Sometimes providing patches, stepping up for maintenance etc. can go a long way, much better than just nagging at (busy) maintainers.

Are there people that are both (1) active in the OCaml community (so they can talk with upstream or otherwise get efficient help when an upgrade fails) and (2) actively contributing to homebrew? Looking at the ocaml formula history, two recent contributors are carlocab and cho-m, their Github profile suggests that they are clearly (2) active brew contributors but not clearly (1) active OCaml users.

Honestly, for my part, if Homebrew were to prioritize keeping up with opam releases, then I would not be super bothered by it having older releases of the OCaml compiler.