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

Add the chapter about extension points #2852

Open
XVilka opened this issue Feb 12, 2018 · 11 comments

Comments

@XVilka
Copy link
Contributor

commented Feb 12, 2018

Nowadays Camlp4 is being deprecated in many libraries and projects and extension points taking its place. There are useful ppx_ libraries already, but not enough documentation how to write your own. Would be nice to have this in the second edition, instead or in addition to Camlp4.

@mars0i

This comment has been minimized.

Copy link

commented May 3, 2018

I recognize that the book is in beta. I don't know if you're interested in adding chunks of material at this point, but I wanted to add to XVilka's comment.

Even if RWO 2 doesn't include a guide to writing ppx libraries, it would be a huge service to the community to include (1) a general introduction to what ppx is and what ppx libraries do in general, with (2) illustrations using some simple but useful examples (e.g. some of the ppx_deriving tools), along with (3) basic advice about how to configure jbuild files to use them. There is nothing like (1) and (3) available anywhere, as far as I can see. (2) exists e.g. in the README file for ppx_deriving on github, but without (1) and (3) it's of limited benefit to newbies. ppx is an important part of the OCaml ecosystem, and it's something that experienced users have picked up, but there's no introduction to it. (I do know about this. It's not a good overview for someone learning OCaml or who has know idea at all what this ppx stuff is. t's more like an introduction to ppx for people who want to begin to understand it deeply.)

One more point: One doesn't find the term "extension points" as often as one sees people talking about "ppx this" and "ppx_that". An introduction to something called "extension points", without "ppx" as a prominent label, wouldn;t easily be found by someone trying to figure out what people were talking about.

Thanks!

@yminsky

This comment has been minimized.

Copy link
Member

commented May 3, 2018

@mars0i

This comment has been minimized.

Copy link

commented May 3, 2018

Excellent. Thank you! I had tried to find ppx references in the new edition, but missed that box and the references in it to other sections. The box does go a long way, but just a little more could be nice--as well as the appropriate jbuild file tricks, which are not obvious at present. (I've been assuming that RWO2 would provide an introduction to Dune, but I haven't looked.)

@mars0i

This comment has been minimized.

Copy link

commented May 3, 2018

Here's an illustration of something that's confusing and not well documented (afaics) about a popular ppx library: https://discuss.ocaml.org/t/another-question-about-using-ppx-with-dune-jbuilder/1941/2?u=mars0i

(Not that it's RWO's responsibility to clarify this, but thought it might be worth mentioning as an illustration.)

@yminsky

This comment has been minimized.

Copy link
Member

commented May 3, 2018

@mars0i

This comment has been minimized.

Copy link

commented May 4, 2018

Thanks.

Again, I don't think it has to be RWO's responsiblity to fill all holes in introductory OCaml documentation, but in the long run I hope there will be more nontrivial introductory docs for Dune somewhere. (I don't know enough yet to contribute, but I submitted a Dune issue suggesting there be more examples in the Dune docs. That would be a long term, piecemeal project.)

@XVilka

This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2018

@XVilka

This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2018

@XVilka

This comment has been minimized.

Copy link
Contributor Author

commented Jan 7, 2019

It also makes sense to add a paragraph or two about OCaml AST dumper ocamlfind ppx_tools/dumpast -e

@XVilka

This comment has been minimized.

Copy link
Contributor Author

commented Mar 14, 2019

@XVilka

This comment has been minimized.

Copy link
Contributor Author

commented May 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.