Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pedrobslisboa/ppx-by-example

This repository contains examples to help on understanding what are and how to write PPXs in OCaml.
https://github.com/pedrobslisboa/ppx-by-example

ocaml ppx ppxlib reasonml

Last synced: 3 months ago
JSON representation

This repository contains examples to help on understanding what are and how to write PPXs in OCaml.

Awesome Lists containing this project

README

        

## PPX by examples

:warning: **This repository is a work in progress.** :warning:

This repository contains examples to help on understanding what are and how to write PPXs in OCaml and for it we are going to use PPXLib.

On my ppx learning journey, I'm having some difficulties to find examples and explanations about how to write a PPX. So, I decided to create this repository to help others that are in the same situation as me, and also push me into learning more about it.

So as I said, I'm learning, and I'm not an expert on the subject. If you find any mistake or have any suggestion, please open an issue or a pull request. I'll be glad to receive your feedback.

## Content

- [AST](./examples/1%20-%20AST/README.md)
- [Building an AST](./examples/1%20-%20AST/a%20-%20Building%20AST/README.md)
- [Destructing an AST](./examples/1%20-%20AST/b%20-%20Destructing%20AST/README.md)
- [Writing a PPX](./examples/2%20-%20Writing%20PPXs/README.md)
- [Context-free transformations](./examples/2%20-%20Writing%20PPXs/a%20-%20Context%20Free/README.md)
- [Global transformations](./examples/2%20-%20Writing%20PPXs/b%20-%20Global/README.md)
- Testing a PPX (wip)

## References

- [Ocaml Metaprogramming Docs](https://ocaml.org/docs/metaprogramming)
- [PPXLib documentation](https://ocaml-ppx.github.io/ppxlib/ppxlib/index.html)
- [The needed introduction to writing a ppx](https://www.youtube.com/live/dMoRMqQ6GLs?feature=shared&t=4251)
- [An introduction to OCaml PPX ecosystem
](https://tarides.com/blog/2019-05-09-an-introduction-to-ocaml-ppx-ecosystem/)