How does upstream plan to prevent a Python 2/3 Perl5/6 situation with that?
I don’t think this situation is comparable with Python 2/3. This is somewhat similar to the Scala 2.x/Scala 3 debate that is going on on the internet – people are seeing shades of the Python 2/3 debacle in that too. If fact you can check out this presentation by Martin Odersky the creator of scala where he gives a reason why Scala 2.x/3 is not going to suffer the debacle of Python 2/3 https://youtu.be/JcLG9Ss9Y-w?t=3333 at 0:55:30 – the reasons are quite similar to why Ocaml 4.x/5.0 wont suffer the debacle of Python 2/3 !!
The reasons why Python 2/3 was a big issue but will not be an issue for OCaml 4.x/5.x is that:
- Python is not statically typed. So you may have a code base of thousands of lines and you will need to inspect it manually or with regexes or other imperfect tools to port it to Python 3. Even then you’re not fully sure due to the dynamic nature of the language. With Ocaml 4.x/5.0 the strong static typing should inform you about any incompatibility easily. If there are any new syntactic constructs they will not compile in Ocaml 4.x. If there any stdlib features required for effects those sub-modules will not be available in a OCaml 4.x compiler e.g. the
Obj.Effect_handlersmodule is not there in Ocaml 4.x – you get the picture – Your compiler will prevent problems if you were to inadvertently mix OCaml 5.x and OCaml 4.x code - Another reason that came up in the Scala 3 presentation linked above was that for a long time Python 2 and Python 3 were more or less equivalent and there was no compelling reason to shift to Python 3. Apart from some annoying incompatibilities and “cleanups” Python 3 didn’t provide anything compelling. Only a few versions into Python 3, did Python 3 provide a real reason to shift over. This is not the case with OCaml 5.0 – it provides a compelling reason to migrate – multicore and effects! So again, Ocaml 4.x/5 will be a different situation than Python 2/3
My understanding is that any code written for a recent OCaml 4.x will work without any changes on OCaml 5.0 down to the FFI which should provide a smooth upgradation path.
I’m not a OCaml compiler contributor or part of the compiler team but my understanding is that there is no plan to make any change to 4.14 that would render your code incompatible with OCaml 5.0. So you will always be able to move “up” without any changes (of course if you’re doing some really low level things in C that guarantee may not hold true).
These are not promises or assurances Python 2 gave or could give.