-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Might it make sense to upstream this to ppxlib.metaquot? #4
Comments
I started `metaquot` before `ppxlib` ceased to be able to work with
other `ppx` drivers. The initial goal was to have a "metaquoter"
targetting the current version of the compiler AST, this goal is now
deprecated since all `ppx` rewriters should use the `ppxlib` driver now
(otherwise, they didn't compose with anything using `ppxlib`), and
`ppxlib` imposes its fixed version of the compiler AST. I adapted
`metaquot` minimally to be usable with `ppxlib` (by targetting the
`ppxlib`-versioned AST), so that my other projects that was relying on
`metaquot` don't break (and work with `ppxlib`), but ideally everyone
should use `ppxlib.metaquot` now.
I am not sure that additional features of `metaquot` are worth being
integrated to upstream `ppxlib.metaquot`: it was mainly a playground for
me to experiment some facilities, but I don't know if we want to pay the
maintenance burden. The most interesting thing I see in `metaquot` is
that it is mainly automatically generated by preprocessing
compiler-libs' Parsetree module with `metapp`, but `ppxlib.metaquot` has
a very different design.
I would be glad if `metapp` itself becomes more visible in the
`ppx`-ecosystem, because I think it could be very useful for the
community, but it doesn't seem to be liked (I certainly failed to
promote it well, but the couple of announces I made on it didn't catch
much attention).
|
Thanks for the context and history on this, that's very interesting! I understand far better now why this metaquot co-exists with ppxlib.metaquot.
I see! Part of that might be similar to ppxlib.metaquot, which uses a "lift" class that's generated by preprocessing the Ppxlib AST: a class that for each node in the Ppxlib AST provides a method to capture that node representation in the given target:
The features I was thinking about are |
FWIW, |
If I'm not missing anything, this version of metaquot is strictly better than ppxlib.metaquot in the sense that its features are a super-set of the ppxlib.metaquot features. Is that right? Are there maybe also some downsides to it that I'm currently not seeing (performance or similar)?
I think it would be great to discuss the context around that a little! Concretely, why is this a separate project instead of being upstreamed to ppxlib.metaquot? Are there any technical issues that upstreaming it would involve? Are some of the features that are here and not in ppxlib.metaquot controversial?
Of course, we wouldn't upstream this from one day to another, but it might be worth looking into that, so I'd love to hear your opinion @thierry-martinez!
The text was updated successfully, but these errors were encountered: