I’d like to continue the discussion that was started in another thread about backwards compatibility by pointing to what seems to me to be a true marvel of backwards compatibility: the Rust compiler. Please read this page, and the part I’d like to focus on is
A Rust compiler will support all editions that existed prior to the compiler’s release, and can link crates of any supported editions together.
This is an amazing property, and I’m not sure how the Rust community accomplishes it. One thing that probably helps is the fact that they use LLVM for the backend (leading to fewer changes in the backend). How, though, are they able to do things like adding new keywords to the language, while supporting all versions in the same compiler? My first guess is that every new ‘edition’ includes the previous editions’ code, but perhaps I’m wrong.
It would be really nice if we could start using some kind of more meaningful semantic versioning in OCaml, and in particular, if this Rust scheme is doable, adopt this versioning scheme for ourselves as well.