https://github.com/ocaml-ppx/ppxlib
Base library and tools for ppx rewriters
https://github.com/ocaml-ppx/ppxlib
Last synced: 10 months ago
JSON representation
Base library and tools for ppx rewriters
- Host: GitHub
- URL: https://github.com/ocaml-ppx/ppxlib
- Owner: ocaml-ppx
- License: mit
- Created: 2018-03-13T15:20:35.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2025-03-03T10:39:32.000Z (about 1 year ago)
- Last Synced: 2025-03-31T22:17:46.235Z (11 months ago)
- Language: OCaml
- Homepage:
- Size: 11.2 MB
- Stars: 260
- Watchers: 15
- Forks: 100
- Open Issues: 79
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-list - ppxlib - ppx | 146 | (OCaml)
README
# Ppxlib - Meta-programming for OCaml
[![ocaml-ci status][ocaml-ci-img]][ocaml-ci] [![trunk-build-status][trunk-build-img]][trunk-build] [![AppVeyor status][appveyor-img]][appveyor]
[ocaml-ci]: https://ci.ocamllabs.io/github/ocaml-ppx/ppxlib
[ocaml-ci-img]: https://img.shields.io/endpoint?url=https%3A%2F%2Fci.ocamllabs.io%2Fbadge%2Focaml-ppx%2Fppxlib%2Fmain&logo=ocaml
[appveyor]: https://ci.appveyor.com/project/diml/ppxlib/branch/main
[appveyor-img]: https://ci.appveyor.com/api/projects/status/bogbsm33uvh083jx?svg=true
[trunk-build]: https://github.com/ocaml-ppx/ppxlib/actions/workflows/trunk-build.yml
[trunk-build-img]: https://github.com/ocaml-ppx/ppxlib/actions/workflows/trunk-build.yml/badge.svg?branch=main
[Ppxlib documentation][doc]
# Overview
Ppxlib is the standard library for ppx rewriters and other programs
that manipulate the in-memory representation of OCaml programs, a.k.a.
the "Parsetree".
It also comes bundled with two ppx rewriters that are commonly used to
write tools that manipulate and/or generate Parsetree values:
`ppxlib.metaquot`, which allows constructing Parsetree values using the
OCaml syntax directly, and `ppxlib.traverse`, which provides various
ways of automatically traversing values of a given type, in particular
allowing to inject a complex structured value into generated code.
For more information about ppxlib and how to use it, please consult the
[documentation][doc].
# What is the relation between ppxlib and other ppx libraries?
The ppx world has a long and storied history, and if you look around, you
may find other projects that offer functionalities similar to
ppxlib. The following [blog post][future-of-ppx] gives a good overview
of the various libraries that have been developed over time. At this
point, ppxlib is considered the de facto library for writing ppx
rewriters.
# History of the project
This repository was created by merging several older smaller projects
that were developed at Jane Street. See [the history](HISTORY.md) for
more details.
[doc]: https://ocaml-ppx.github.io/ppxlib/ppxlib/index.html
[future-of-ppx]: https://discuss.ocaml.org/t/the-future-of-ppx/3766