It would be convenient to have a tool that can convert OCaml typing information, in particular Env.summary
and possibly Subst.t
, from a given version of OCaml to a later version of OCaml. (Ideally, whole .cm{i,o,t,ti}
files could be converted this way.) Intuitively this should be possible as new versions rarely remove information or make things inexpressible, and it could be useful for many tooling authors, who could consider supporting one recent version of OCaml and converting older artifacts on the fly.
Has someone tried to do this before? Does someone know that it is possible, or that it is blocked by some fundamental issue? (I wonder in particular if the Merlin people have thought about it; cc @let-def @trefis , and also maybe @ejgallego experiments .)
The question comes from a discussion with @hackwaly of how to have ocamlearlybird support multiple versions of OCaml in a robust/maintenable way.