You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose you have code that uses ppx_tools_versioned and ocaml-migrate-parsetree. The code builds up an Ast_404 parsetree and then, as a last step, when it comes time to generate .ml and .mli files from the AST, it runs Version.migrate Versions.ocaml_404 Versions.ocaml_current.
I'm attempting to port this code to ppxlib but I'm having trouble finding the Versions.migrate. Is this still provided? I notice there's a lot of macro stuff so maybe my grepping misses it.
If it's no longer provided, what should be done instead?
Thank you kindly!
The text was updated successfully, but these errors were encountered:
Hi @mbacarella, thanks for porting your ppx to ppxlib! When you use ppxlib, the migration is done by ppxlib itself, so you don't need to do anything in that regard. You'll just need to use ppxlib to write your AST node(s). For that, you can use -from highest level to lowest level- metaquot, Ast_builder (which is similar to the former Ast_helper which you might know) or build the nodes directly. All three options produce nodes in the AST version from the latest released compiler (currently 4.14).
Whenever your ppxlib PPX is used in a project, ppxlib takes care of migrating the AST of the project to the latest AST version, then applies your PPX and then migrates the AST back to the version it came from.
Thanks for the answer. This is helpful. A question on future compatibility: I assume the ppxlib exposed AST cannot know what future versions of OCaml will have, so it's possible to support new versions of OCaml in ppxlib, a backward incompatible change to the AST will be required and thusly ppxlib users will need updating?
Suppose you have code that uses
ppx_tools_versioned
andocaml-migrate-parsetree
. The code builds up an Ast_404 parsetree and then, as a last step, when it comes time to generate .ml and .mli files from the AST, it runsVersion.migrate Versions.ocaml_404 Versions.ocaml_current
.I'm attempting to port this code to
ppxlib
but I'm having trouble finding theVersions.migrate
. Is this still provided? I notice there's a lot of macro stuff so maybe my grepping misses it.If it's no longer provided, what should be done instead?
Thank you kindly!
The text was updated successfully, but these errors were encountered: