Skip to content

Commit 3b2104f

Browse files
authored
Update metaprogramming.md
1 parent 66c5ce4 commit 3b2104f

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

content/metaprogramming.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ It allows for many features that aren't included in the core language to be adde
99
particularly ones that involve reducing boilerplate code.
1010
For example, there's usually no need to write code manually for the serialization or comparison of types.
1111

12-
A great introduction to PPX metaprogramming can be found [here](https://ocaml.org/docs/metaprogramming).
12+
A great introduction to `ppx` metaprogramming can be found [here](https://ocaml.org/docs/metaprogramming).
1313
The history and current situation of the PPX ecosystem is presented elegantly in [this post](https://discuss.ocaml.org/t/the-future-of-ppx/3766).
1414

15-
## Authoring
16-
17-
Authoring a PPX extension is covered by the excellent [ppxlib user manual](https://ocaml.org/p/ppxlib/latest/doc/index.html).
18-
1915
## PPX Extensions
2016

2117
This is a list of PPX extensions currently available.
@@ -57,13 +53,15 @@ A monadic syntax extension from Jane Street.
5753
* [ocaml-monadic](https://github.com/zepalmer/ocaml-monadic):
5854
Another monadic syntax extension.
5955
* [ppx_regex](https://github.com/paurkedal/ppx_regexp):
60-
Contains 2 ppx parsers to OCaml [regex](regular_expressions.md) libraries:
56+
Contains 2 ppx parsers [regex](regular_expressions.md) libraries:
6157
* ppx_regexp: maps to use Re (untyped regex)
6258
* ppx_tyre: maps to use Tyre for typed regex.
59+
* [ppx_inline_test](https://github.com/janestreet/ppx_inline_test):
60+
Inlined unit testing. See [Testing](testing.md).
6361
* [ppx_expect](https://github.com/janestreet/ppx_expect):
64-
Cram-like tests for OCaml. See [Testing](testing.md).
65-
* [Bisect_ppx](https://github.com/aantron/bisect_ppx):
66-
Code coverage for OCaml. See [Code Tools](code_tools.md).
62+
Inlined expect-based unit testing. See [Testing](testing.md).
63+
* [bisect_ppx](https://github.com/aantron/bisect_ppx):
64+
Code coverage tool. See [Code Tools](code_tools.md).
6765
* [ppx_pgsql](https://github.com/tizoc/ppx_pgsql):
6866
A syntax extension for embedded SQL queries using PG'OCaml. See [Databases](databases.md).
6967
* [ppx_cstubs](https://github.com/fdopen/ppx_cstubs):
@@ -75,30 +73,36 @@ Display nice error messages with source location. For compilers etc.
7573
* [ppx_blob](https://github.com/johnwhitington/ppx_blob):
7674
Include arbitrary file data as a string in OCaml without having to worry about lexical conventions.
7775
* [ppx_deriving_cmdliner](https://github.com/hammerlab/ppx_deriving_cmdliner):
78-
The easiest way to write command-line argument code.
76+
An easy way to write command-line argument code using the `cmdliner` library.
7977

8078
#### Protocol-specific PPX
8179

8280
* [ppx_deriving_yojson](https://github.com/whitequark/ppx_deriving_yojson):
8381
A Yojson codec generator for OCaml. See [Serialization](file_formats.md#Serialization).
8482
* [ppx_yojson_conv](https://github.com/janestreet/ppx_yojson_conv):
85-
Alternative to `ppx_deriving_yojson` from Jane Street.
83+
Newer alternative to `ppx_deriving_yojson` from Jane Street.
8684
* [ppx_yojson](https://github.com/NathanReb/ppx_yojson):
87-
Convert JSON expressions to `yojson` AST, allowing your code to be cleaner.
85+
Convert JSON expressions in OCaml code to `yojson` AST, allowing your code to be cleaner.
8886
* [ppx_deriving_protobuf](https://github.com/ocaml-ppx/ppx_deriving_protobuf):
8987
Derive Protobuf files from OCaml types. See [Protocols](protocols.md).
9088
* [ppx_sexp_conv](https://github.com/janestreet/ppx_sexp_conv):
91-
Derive converters to s-expressions.
89+
Derive converters to s-expressions,
90+
the same serialization format used by `dune`.
9291
* [ppx_protocol_conv](https://github.com/andersfugmann/ppx_protocol_conv):
9392
Framework for multiple serializers for different protocols.
9493

95-
## Writing PPX Extensions
94+
## Writing ppx Extensions
9695

97-
Writing PPX libraries is generally not trivial,
96+
Writing `ppx` libraries is generally not trivial,
9897
but there are ongoing efforts to make it easier.
99-
100-
* [ppxlib](https://github.com/ocaml-ppx/ppxlib): The modern solution for writing PPX extensions. Without this library, writing PPX
101-
extensions is fragile and breaks with OCaml version changes. `ppxlib` merges several older projects together to provide a complete
98+
The excellent [ppxlib user manual](https://ocaml.org/p/ppxlib/latest/doc/index.html)
99+
explains in depth how to use the most modern methods.
100+
101+
* [ppxlib](https://github.com/ocaml-ppx/ppxlib):
102+
The modern solution for writing PPX extensions.
103+
Without this library, writing `ppx`
104+
extensions is fragile and breaks with OCaml version changes.
105+
`ppxlib` merges several older projects together to provide a complete
102106
platform for writing efficient, resilient PPX extensions.
103107

104108
### Articles
@@ -116,7 +120,7 @@ A discuss post which turned into an important resource about aspects of PPX writ
116120

117121
## Other MetaProgramming Approaches
118122

119-
Some other approaches and domains exist for metaprogramming in OCaml.
123+
Some other approaches exist for metaprogramming in OCaml.
120124

121125
* [cppo](https://github.com/ocaml-community/cppo):
122126
A simple C++-like preprocessor for OCaml files.

0 commit comments

Comments
 (0)