This project provides the simplest setup to develop your own ppx. Also, includes handy example extensions and derivers to help you to get started.
Stack:
- ReasonML
- Ppxlib
- Esy
You should install your dependencies first:
$ esy
Every time you make a code change in your ppx, you have to build it with this command:
$ esy build
We found that the easiest way is to use BuckleScript! Since BuckleScript transforms our ReasonML code to Javascript, we can read that JavaScript code to see our output. You can find our BuckleScript test environment in the test_bs folder.
References and tools that might help you.
Must-read articles to understand PPX and AST
- An introduction to OCaml PPX ecosystem
- Extension Points - 3 Years Later
- Extension Points - Ppxlib & Dune Update
- Deriving Slowly
- Metaquot
You can read these projects source codes to understand how they solved their problems. Their solutions might guide you to solve your own problems.