Release of ppxlib.0.32.0

The ppxlib dev team is happy to announce the release of ppxlib.0.32.0.

The main feature of this release, implemented by @burnleydev1 during their Outreachy internship, is a huge improvement of the handling of located exceptions raised by ppx-es. Whenever a rewrite of the AST throws such an exception, the ppxlib driver catches it and resumes the rewriting using the latest valid AST it knows of. All caught exceptions are appended to the final AST as [%%ocaml.error ..] nodes. This means the driver returns a valid AST instead of one composed of a single error node corresponding to the first raised exception.
This leads to a much better experience for ppx users as merlin now has a valid AST to work with when this happens, allowing it to properly function and report all errors, from ppx-es or otherwise.
Note that despite this change we still recommend ppx authors to embed errors in the rewritten AST rather than throw exceptions.

The release also comes with a few bug fixes on longident parsing or windows compatibility and a new simplified API for ppx authors using attributes as flags (i.e. attributes without payloads such as [@ignore] for instance).

You can read the full patch notes here.

We’d like to thank our external contributors for this release:

  • @burnleydev1 for their improvement of the driver exception handling
  • @dianaoigo for their addition of the new attribute flags API
  • @jonahbeckford for their fix of the windows compatibility

We’d also like to thank the OCaml Software Foundation who has been funding my work on this release.

7 Likes