ocaml-ppx / ocaml-migrate-parsetree

DEPRECATED. See https://ocaml.org/changelog/2023-10-23-omp-deprecation. Convert OCaml parsetrees between different major versions
Other
87 stars 43 forks source link

Add --print-transformations #55

Closed rgrinberg closed 5 years ago

rgrinberg commented 5 years ago

Like in ppxlib, this will print all the currently registered transformations.

Also, what do you think about printing the currently registered derivers? This will be quite useful but will come at the cost of depending on ppx_derivers. However, that package is pretty fundamental to ppx, so it doesn't seem like an issue.

ghost commented 5 years ago

No objection, but I wonder if we should spend time improving the driver shipped with ocaml-migrate-parsetree. In particular, rewriters registered with ppxlib won't show up here as there are all under a single omp rewriter. In my head, once we have integrated view patterns in ppxlib, then ppxlib is the library we should encourage ppx authors to use and the driver part of omp will eventually disappear.

rgrinberg commented 5 years ago

Honestly I hate to make this change as well. But I'm debugging and issue now that only occurs with the old driver and having this feature proves to be useful. I would certainly prefer only having 1 driver.

ghost commented 5 years ago

Ok. If it's useful for debugging, then it's probably worth having. Regarding the dependency on ppx_derivers, that seems fine to me. @let-def, is that fine for you too? I suppose we could also just include ppx_derivers functionality into omp directly.

rgrinberg commented 5 years ago

I suppose we could also just include ppx_derivers functionality into omp directly.

I think it makes sense to include derivers as part of the source here. But perhaps it should still be a separate opam package? It doesn't have any dependencies on the parsetree stuff.

ghost commented 5 years ago

There is no package that depend on ppx_derivers but not on omp, so I don't think it is necessary to keep them separate if we import ppx_derivers.

rgrinberg commented 5 years ago

ping @diml (or @let-def).

I don't think that adding ppx_derivers has any negative side effects. In the worse case, it can always be reverted.

ghost commented 5 years ago

Agreed, let's merge this.