@@ -9,13 +9,9 @@ It allows for many features that aren't included in the core language to be adde
9
9
particularly ones that involve reducing boilerplate code.
10
10
For example, there's usually no need to write code manually for the serialization or comparison of types.
11
11
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 ) .
13
13
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 ) .
14
14
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
-
19
15
## PPX Extensions
20
16
21
17
This is a list of PPX extensions currently available.
@@ -57,13 +53,15 @@ A monadic syntax extension from Jane Street.
57
53
* [ ocaml-monadic] ( https://github.com/zepalmer/ocaml-monadic ) :
58
54
Another monadic syntax extension.
59
55
* [ 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:
61
57
* ppx_regexp: maps to use Re (untyped regex)
62
58
* 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 ) .
63
61
* [ 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 ) .
67
65
* [ ppx_pgsql] ( https://github.com/tizoc/ppx_pgsql ) :
68
66
A syntax extension for embedded SQL queries using PG'OCaml. See [ Databases] ( databases.md ) .
69
67
* [ ppx_cstubs] ( https://github.com/fdopen/ppx_cstubs ) :
@@ -75,30 +73,36 @@ Display nice error messages with source location. For compilers etc.
75
73
* [ ppx_blob] ( https://github.com/johnwhitington/ppx_blob ) :
76
74
Include arbitrary file data as a string in OCaml without having to worry about lexical conventions.
77
75
* [ 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 .
79
77
80
78
#### Protocol-specific PPX
81
79
82
80
* [ ppx_deriving_yojson] ( https://github.com/whitequark/ppx_deriving_yojson ) :
83
81
A Yojson codec generator for OCaml. See [ Serialization] ( file_formats.md#Serialization ) .
84
82
* [ 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.
86
84
* [ 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.
88
86
* [ ppx_deriving_protobuf] ( https://github.com/ocaml-ppx/ppx_deriving_protobuf ) :
89
87
Derive Protobuf files from OCaml types. See [ Protocols] ( protocols.md ) .
90
88
* [ 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 ` .
92
91
* [ ppx_protocol_conv] ( https://github.com/andersfugmann/ppx_protocol_conv ) :
93
92
Framework for multiple serializers for different protocols.
94
93
95
- ## Writing PPX Extensions
94
+ ## Writing ppx Extensions
96
95
97
- Writing PPX libraries is generally not trivial,
96
+ Writing ` ppx ` libraries is generally not trivial,
98
97
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
102
106
platform for writing efficient, resilient PPX extensions.
103
107
104
108
### Articles
@@ -116,7 +120,7 @@ A discuss post which turned into an important resource about aspects of PPX writ
116
120
117
121
## Other MetaProgramming Approaches
118
122
119
- Some other approaches and domains exist for metaprogramming in OCaml.
123
+ Some other approaches exist for metaprogramming in OCaml.
120
124
121
125
* [ cppo] ( https://github.com/ocaml-community/cppo ) :
122
126
A simple C++-like preprocessor for OCaml files.
0 commit comments