Skip to content
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

README is a ambiguous as to current best practices for an end user #289

Open
LAC-Tech opened this issue Oct 12, 2024 · 2 comments
Open

README is a ambiguous as to current best practices for an end user #289

LAC-Tech opened this issue Oct 12, 2024 · 2 comments

Comments

@LAC-Tech
Copy link

Hello,

The year is 2024, and I want to pretty print my own ocaml record type.

Is the text in the readme saying I should be using Ppxlib.Deriving for that use case?

Or is this library still recommended for the end user?

@sim642
Copy link
Contributor

sim642 commented Oct 13, 2024

I guess this is about this note in the README:

Note: since deriving was released by whitequark in 2014, the OCaml ppx ecosystem has changed a lot. For new projects wishing to create a new deriving plugin, we recommend using ppxlib directly. The module Ppxlib.Deriving provide functionality similar to deriving, better integrated with ppxlib, and offers a nicer API in some places. deriving is still maintained to keep existing plugins working as well as possible. Although note that the above deprecation note only covers the API and not the plugins (e.g. ppx_deriving.show, ppx_deriving.eq, ...).

The derivers like show in ppx_deriving are still in good shape.

What the note warns about is writing new derivers: they should be written using ppxlib APIs, not ppx_deriving's old APIs. The ppx_deriving plugins themselves have also been ported now in #263, so they follow that advice.

Ppxlib itself does not provide any such plugins, it's just the API.

@LAC-Tech
Copy link
Author

Yes, that comment is a rollercoaster.

Note: since deriving was released by whitequark in 2014, the OCaml ppx ecosystem has changed a lot.

Ok, so ppx_deriving is legacy.

For new projects wishing to create a new deriving plugin, we recommend using ppxlib directly.

Ah but I am not wishing to do that, so nevermind.

The module Ppxlib.Deriving provide functionality similar to deriving, better integrated with ppxlib, and offers a nicer API in some places. deriving is still maintained to keep existing plugins working as well as possible.

Wait so this newer library does the same thing as this module, and this module is only maintained for legacy reasons?

Just make it really cut and dry:

Note: For projects wishing to create new deriving plugins, use ppxlib directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants