OCaml Changelog


Read the latest releases and updates from the OCaml ecosystem.

After giving space for feedback and objections by the community, we have deprecated ocaml-migrate-parsetree (aka OMP). It is superseded by Ppxlib.

There are four major differences between OMP and Ppxlib, which all go hand in hand.

The first major difference is in the library and therefore impacts how to write PPXs. With OMP, each PPX author had to choose a parsetree version to define their PPX against. There was no version agreement between different PPXs. With Ppxlib, each PPX author uses the same parsetree version.

The second major difference is about compatibility with new compiler syntax. While with OMP, each PPX was on its own parsetree version, Ppxlib keeps them all on the version of the latest stably released compiler. That makes using any PPX compatible with using the latest compiler syntax features!

The third major difference is in the philosophy of PPXs. With OMP, all PPX transformations were global transformations, i.e., transformations of the whole parsetree. Ppxlib has introduced the concept of "context-free" transformations, i.e., transformations that transform only one parsetree node. By restricting their scope of action, context-free PPXs are a lot more predictable and less dangerous! Also, Ppxlib merges all context-free PPXs into one parsetree pass, defining clear semantics of PPX composition.

The fourth major difference is in the driver, i.e., the binary that drives the application of all used PPXs in a project. The Ppxlib driver is significantly more performant than the OMP driver used to be. That's partly because it does a lot fewer parsetree migrations and partly thanks to merging all context-free PPXs into one parsetree pass.

As a consequence of the deprecation, OMP will be incompatible with any new compiler version. The first incompatible compiler version is OCaml 5.1.

Thanks a lot to everyone involved in OCaml's transition from OMP to Ppxlib, for example by porting their PPX!

See full changelog
  • No longer expose the unwrapped modules (#94, @jonludlam)
  • Remove everything but Ast versions and upgrade/downgrade conversions (#103, @ceastlund)
See full changelog
  • Preserve compiler version of binary ASTs across transformation (#79, @aantron)
  • Allow not exiting on error (#83, @aantron)
See full changelog
  • Add support for 4.10 (#86, @diml)
  • Infer file kind (interface or implementation) for binary ASTs that have no extension (#80, @aantron)
  • Add ?argv argument to Driver.run_main (#82, @aantron)
See full changelog
  • Initial support for 4.09, tested with 4.09+beta1 (#76, @hhugo)
  • When encoding errors into the AST, duplicate the error message for "ocaml.error" nodes for OCaml versions < 4.08 (#75, @xclerc)
See full changelog
  • Make sure opening Ast_408 doesn't shadow Int or Misc (#71, @hhugo)
  • Fix a couple of issues related to upgrading the AST from 4.07 to 4.08 (#71, @hhugo)
See full changelog
  • Get rid of the ocamlbuild plugin. Nobody is using it in opam and it is more work to maintain (#63, @diml)
  • Set Location.input_name to the original filename when reading a binary AST (#66, @diml)
  • Add support 4.08 (#70, @xclerc)
See full changelog
  • Remove unused ocamlfind dependency in the opam file (#53, @diml)
  • Add --print-transformations to list registered transformations (#55, @rgrinberg)
  • Fix Windows compatibility by setting the output to binary mode when writing a binary ast (#57, #59, @bryphe and @dra27)
  • Switch to dune and opam 2.0 (#58, #60, @diml)
See full changelog
  • Add a --null argument to suppress the output. This is used to write linters
  • Use the new generic ppx driver support of jbuilder
See full changelog
  • Driver: add --as-pp and --embed-errors flags.

    --embed-errors causes the driver to embed exceptions raised by rewriters as extension points in the Ast

    --as-pp is a shorthand for: --dump-ast --embed-errors

  • Expose more primitives for embedding the driver.

  • Fix bug where reset_args functions where not being called.

  • Fix "OCaml OCaml" in error messages (contributed by Adrien Guatto).

See full changelog
  • Fix findlib predicates:
    • replace omp_driver by ppx_driver
    • replace -custom_ppx by -custom_ppx,-ppx_driver
If you want to contribute to a new release announcement, check out the Contributing Guide on GitHub.