Question to compiler devs: Will there be a release after which backward compatability is maintained?

OCaml has seen a significant amount of change over the last few years with lots of significant improvements not only in the compiler but also the tooling. My question is simple: Are there plans to pick a compiler version after which backward compatibility will be maintained?

I ask because maintained a library can be difficult (and time consuming) if you want to allow older versions of the compiler. This is important as not everyone can move compiler versions with the same velocity.

Hey Blez!

I’m curious what problems you’ve run into. The OCaml compiler proper tends to be pretty stable, in my experience. Is it the compiler and the language itself that you’re running into issues with? Or is it more about the tooling?

Some parts of the tooling are definitely evolving faster than others, and there’s no one unified group behind all of it. For example, Dune itself is very new, and evolving pretty fast, though I think a decent backwards compatibility story is falling into place. Other tools and libraries are landing all the time, though, so depending on what you depend on, you’ll get a very different experience.

Anyway, I’d love to know more about what changes have bitten you.


I originally came across the compatibility issues with PPX derivers, but that was really expected and has mostly been fixed with OMP. However, I think this sensitised me to some of the issues around dealing with multiple compiler versions. Reading @lpw25’s excellent post on the plans for 4.08 got me thinking about the longer term.

As OCaml gains popularity and OPAM grows how do we handle the implications of breaking backward compatibility? My experience suggests that CPPO would not be my first choice! Maybe we allow the selection of the “standard” on the compiler command line much like gcc supports multiple ANSI standards. This would be easy to tie in with dune nicely,

Food for thought


1 Like

As the author of cppo, my sincere advice is to not use it unless it’s too late. Instead, you should write code that won’t require crazy maintenance.