Skip to content

Is this project still alive? #95

Description

@glondu

This project does not compile with OCaml 5 and does not seem to be used anymore, at least by other software packaged in Debian. However, I did not see any deprecation notice. Is this project still alive?

Activity

  1. glondu commented on Jan 6, 2025

    @glondu
    ContributorAuthor
  2. kit-ty-kate commented on Jan 6, 2025

    @kit-ty-kate
    Collaborator

    It is not, see #94 (comment) for more details.

    I'll add a deprecation notice to the readme.

  3. fpottier commented on Oct 10, 2025

    @fpottier

    At the moment I still need ppx_tools/rewriter while building the documentation of visitors. Is there a replacement for ppx_tools/rewriter?

  4. kit-ty-kate commented on Oct 10, 2025

    @kit-ty-kate
    Collaborator
  5. NathanReb commented on Oct 13, 2025

    @NathanReb

    The project is unmaintained but any tools that has active users should be ported to ppxlib-tools, I'll take a look at rewriter!

  6. fpottier commented on Oct 13, 2025

    @fpottier

    Thanks! All I need is a way of printing the code after it has been preprocessed.

  7. NathanReb commented on Oct 13, 2025

    @NathanReb

    This should already be doable with ppxlib, can you give me a bit of context of how you'd like to do this?

    For instance you can assemble a ppxlib driver as follows, ppx_driver.ml:

    let () = Ppxlib.Driver.standalone ()

    and dune:

    (executable
      (name ppx_driver)
      (libraries ppxlib <list of ppx-es you want to use>))

    Then:

    dune exec -- ./ppx_driver.exe test.ml
    

    will preprocess test.ml and print the resulting AST as OCaml source code.

  8. fpottier commented on Oct 13, 2025

    @fpottier

    Thanks, I didn't know about this. I will try it.

  9. fpottier commented on Nov 12, 2025

    @fpottier

    Hi Nathan, I have tried your suggestion, and it seems to work. Unfortunately the preprocessed code that I obtain is quite ugly because it contains a lot of @ppxlib.migration.stop_taking attributes, like this:

    method visit_EAdd env =
    (( fun c0 ->
    (( fun c1 ->
    let r0 = self#visit_expr env c0 in
    let r1 = self#visit_expr env c1 in
    ())[@ppxlib.migration.stop_taking]))
    [@ppxlib.migration.stop_taking ])

    See the current version of the visitors manual for more examples: Figure 1, Figure 13, for example.

    Is there a way of saying that I do not want these attributes to exist?

  10. NathanReb commented on Nov 12, 2025

    @NathanReb

    Which version of ppxlib and which version of the compiler are you using? The latest ppxlib, i.e. 0.37.0 should remove those when printing the preprocessed AST as source code. Could you also paste the driver's command line invocation?

    If you're getting this with ppxlib.0.37.0 or higher then that's a bug in ppxlib!

  11. fpottier commented on Nov 12, 2025

    @fpottier

    I was using 0.36.0. I just tried 0.37.0 and it works: the ugly attributes are gone. Thanks for your quick reply!

  12. fpottier commented on Nov 12, 2025

    @fpottier

    This said, I see that the output is a bit awkward, as it uses an explicit fun:

    method visit_EAdd env =
      fun c0 c1 ->
      let r0 = self#visit_expr env c0 in
      let r1 = self#visit_expr env c1 in
      ()

    Why doesn't the printer print method visit_EAdd env c0 c1 = ...? Do you have an idea? (I used to obtain this nicer result when I used ppx_tools/rewriter.)

  13. fpottier commented on Nov 14, 2025

    @fpottier

    Never mind. From now on visitors will decorate every method with a type annotation, like this: method visit_EAdd : _ -> expr -> expr -> unit = fun env c0 c1 -> .... So the nicer result that I asked for above cannot be obtained anyway.

  14. NathanReb commented on Nov 14, 2025

    @NathanReb

    This could be a few different things and I'd need to try and reproduce it to figure out what's happening here. From your example above, it looks like an arity issue, i.e. the method body would not be represented as:

    Pexp_function [env; c0; c1] ...

    but as:

    Pexp_function [env] (Pexp_function [c0; c1] ...)

    making it so Pprintast does not "resugars" it properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions