Hi, I’m wondering if there’s some standard policy in ocaml, for which version is the oldest supported version? So for instance, maybe any Ocaml version < 4.00 would be unsupported, meaning that any request for help from the maintainers would get a “upgrade to something more recent and then check back with us” ??
I personally use something pretty recent, and upgrade my code as I revisit it, but just wondering what’s the standard.
For my personal projects I try to keep my code compatible with ocaml { >= "4.03" }. CI helps a lot. Otherwise, imho, a reasonable policy for libraries is to depend on >= 4.06, which is now available almost everywhere, even BS. For a binary, do what you want
I guess I better explain why I’m asking. I’m wondering (for an Ocaml project I’m trying to maintain) what version of Ocaml I should consider as the “oldest I’ll try to support”. I mean, if nobody using version 3.NN is going to get support from the maintainers, it’s reasonable to not bother supporting it, myself.
I think a reasonable “oldest supported version” to pick is the one that is currently available in debian stable, as it’s probably a lower bound on the versions that people might have in the wild.
That would mean ocaml 4.05 right now (in debian buster).
To support Armael’s point, I believe there was a recent discussion within the dev team that concluded with “we’re supporting whatever version is on Debian stable, we should not make changes that break code aimed at that version.”
Note that I don’t speak for the dev team, but you can place your bet on 4.05.
By the way, I’d be curious to know if some people were using 3.XX in a development setting and why they do so.
I just support the oldest version I can without jumping through too many painful hoops (like my dependencies not working on older versions). It certainly helps to have CI to see when you have regressions regarding that and can then act (by either fixing it or declaring it outdated). I don’t think I would even consider supporting anything older than 4.02 and certainly not 3.xx.
If you need to support older versions you can take a look at Future syntax, stdlib-shims and stdcompat.
Although you’ll probably be limited by what Dune itself supports: Dune 1.x needs OCaml 4.02 minimum, and Dune 2.x needs 4.06 minimum.
Four years ago, I concluded based on this discussion, that the right supported compiler range for my packages should be >= 4.05.0. B/c that’s what Debian stable suppported. Today, Debian stable is at 4.11.1, and I wonder if people have updated their definition of “supported compiler range” ?
I’m asking b/c let* syntax (for instance) isn’t supported at 4.05.0. There are probably other things missing, too, but that’s the first I’ve come across.
I wish. Xen is still limited to OCaml 4.05 compatible code, because its CI runs on debian oldstable (and upgrading that is non-trivial given that is hasn’t happened yet). This also means no dune (well it could use dune 1.x but most build system features would need a 2.x dune).
However Xen doesn’t use any external OCaml libraries, so don’t let that hold you back on your packages!
In other projects I’ve been able to move to 4.08/4.13 long ago, however there is a particular codebase that I’ll likely have to support on OCaml 4.08 for about 7 more years (critical bugfixes only), but there were already cases where code from newer versions had to be backported, together with some helpers to make building on 4.08 possible, so usually if the changes are small supporting an older compiler isn’t exceedingly difficult, and I don’t think upstream packages should necessarily hold back on what minimum compiler version they support too much.
In particular there are some notable improvements in the stdlib in newer versions that I’ve quite liked (as you mention ‘let*’ syntax, and I’d say ‘Seq’ and others, so ~4.08?).