ppx-examples
ppx-examples copied to clipboard
PPX Examples written in ReasonML and Ppxlib
ppx-examples
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
Commands
Install Dependencies
You should install your dependencies first:
$ esy
Build
Every time you make a code change in your ppx, you have to build it with this command:
$ esy build
What about testing and code output?
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.
Useful links for ppx development
Reference and tools
References and tools that might help you.
Articles
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
Projects to look into
You can read these projects source codes to understand how they solved their problems. Their solutions might guide you to solve your own problems.