chetmurthy / pa_ppx

Implementation of PPX rewriters using camlp5 infrastructure
7 stars 2 forks source link

pa_ppx advantages over ppxlib demonstration? #1

Open MdeLv opened 4 years ago

MdeLv commented 4 years ago

https://github.com/chetmurthy/pa_ppx/blob/master/README.md claims:

the goal here is to show how easy it is to write PPX rewriters this way.

Can you show a detailed comparison that highlights the advantages of writing a ppx syntax extension with camlp5 compared with ppxlib?

FYI, I know a very little bit about ppx and I never wrote any ppx extension bigger than a trivial one. Hence the question.

Thanks.

chetmurthy commented 4 years ago

Sure, that's coming -- I just have to get this project into a state that is sufficiently "done" that I can release it (and the camlp5 v8.00 that underpins it). That's going to take a little more time, but if you'd like, we could arrange a time for a telecon, and I could walk you thru the code to show you. That would take, maybe, a half-hour? You can find me at the Ocaml discussion forum as "Chet_Murthy" -- and can message me there.

MdeLv commented 4 years ago

Uh! One of the fastest github answer, ever! To start with, have you a few screenshots available?

chetmurthy commented 4 years ago

I don't have any documentation at all -- literally nothing. B/c I've been too busy writing code grin. I mean, you're seeing a re-implementation of a -bunch- of different PPX rewriters, all from reverse-engineering their -output-, b/c (a) the PPX libraries and rewriters (to me) seem pretty bloody complicated, (b) reading their code would have sort of defeated the point of doing this -- my argument is that it's easier to accomplish these tasks with camlp5, and reading the details of how they accomplished these tasks with (e.g.) ppxlib would be cheating, right?

chetmurthy commented 4 years ago

I mean, the first commit was 14 April. It's been just over 5 weeks.

MdeLv commented 4 years ago

Ok. Did you write some kind of specification of pa_ppx before programming it? (even a basic one)

chetmurthy commented 4 years ago

grin of course not. If I could write specifications, I'd have written documentation already, right?