[ANN] ppxlib.0.36.0

The ppxlib team is happy to announce the release of ppxlib.0.36.0!

A full account of the changes can be found on the 0.36.0 release.

OCaml 5.2 Internal AST

The main change in this release is that the internal AST used in ppxlib is now the same as OCaml 5.2’s AST. Previously it was 4.14.0. The internal AST dictates what features your ppx can and cannot generate. To avoid confusion, this does not mean ppxlib only supports OCaml 5.2 and greater. Ppxlib still supports compilers starting at 4.08.0.

The bump to 5.2 has caused a lot of reverse dependencies to break as the 5.2 AST represents functions differently (see the Syntactic Function Arity RFC). Many patches have already been sent to users of ppxlib in the past few months, but quite a few still remain.

:warning: Ppx authors are advised to read the wiki entry for upgrading to ppxlib.0.36.0. :warning:

Please do not hesitate to reach out if you need any help upgrading to ppxlib.0.36.0.

Other Changes

  • Change Location.none to match the compiler’s Location.none as of OCaml
    4.08.
  • New ways to create context free rules using floating expansions – see #560 for the details.
  • Add a -raise-embedded-errors flag to the driver. Setting this flag raises the first
    ocaml.error embedded in the final AST.
  • Export Ast_pattern.fail making it easier to write new pattern-matchers.
  • Improvements to Ast_traverse.sexp_of to be more concise.

Do read the changes entry/release for all of the acknowledgments – thank you to everyone who contributed to this release of ppxlib! A special thanks from me to @NathanReb who has been a massive help getting this work over the line.

Thank you to Tarides and Jane Street for funding my time on this release of ppxlib.

8 Likes

To save other people on debugging time, if my understanding is correct this change also introduces pvb_constraint (first present on OCaml 5.0). This is not mentioned on the wiki page for upgrading.

Thank you for the work!

1 Like

Thanks @lukstafi. We went all the way from 4.14 to 5.2 and this did indeed add the new pvb_constraint field to value bindings. I’ve added a little section to the end of the upgrade guide to explain this and help ppx authors upgrade their ppxes. Thanks again for taking the time to report this.

1 Like

Concerning the value, you might want to mention the coercion version:

let x : < m : int> :> < > = object method m = 0 end 

and it is probably also useful to mention than prior to 5.1

let x : int = 0

will duplicate the type constraint and desugar to

let (x:int) = (0:int)
1 Like