@@ -39,12 +39,13 @@ How atdml differs from atdgen
3939| Output files | ` foo_t.ml ` + ` foo_j.ml ` (+ ` _b ` , ` _v ` ) | ` foo.ml ` + ` foo.mli ` |
4040| JSON intermediate | Streaming (no AST) | ` Yojson.Safe.t ` |
4141| Default variants | Polymorphic (`` `Foo `` ) | Classic (` Foo ` ) |
42- | Creation functions | Optional ( ` -create-mandatory ` ) | Always generated |
43- | Naming convention | ` read_foo ` / ` write_foo ` | ` foo_of_yojson ` / ` yojson_of_foo ` |
42+ | Naming convention | ` foo_of_string ` / ` string_of_foo ` | ` foo_of_json ` / ` json_of_foo ` |
43+ | Submodules | No | Yes ( ` foo ` = ` Foo.t ` ) |
4444| PPX naming compat. | No | Yes (` ppx_yojson_conv ` ) |
4545| Runtime library | ` atdgen-runtime ` | Inlined in generated file |
4646| Performance | Optimized | Simpler but slower (?) |
4747| Biniou support | Yes | No |
48+ | ATD module imports | No | Yes |
4849
4950Polymorphic variants can be opted into per sum type with
5051` <ocaml repr="poly"> ` . Default field values are inferred from the type for
@@ -58,17 +59,15 @@ Consider atdml if:
5859
5960- You are writing a new OCaml project and want clean, readable generated code
6061 that is easy to debug.
61- - JSON parsing performance is not a bottleneck in your application.
6262- You want generated code that is compatible with the ` ppx_yojson_conv `
6363 naming convention, so it can coexist with PPX-derived types.
6464- You want a single output module per ATD file instead of the ` _t ` /` _j ` split.
6565
6666Stick with atdgen if:
6767
68- - You have an existing codebase that already uses atdgen and migration is not
69- worthwhile.
7068- You need Biniou support.
71- - JSON parsing performance is critical.
69+ - JSON parsing performance is already your bottleneck with atdgen.
70+ - You don't need new features.
7271
7372Status and reliability
7473--
@@ -78,14 +77,9 @@ Status and reliability
7877battle-tested in production. Expect rough edges, missing features, and
7978possible bugs. Contributions and bug reports are very welcome.
8079
81- Features not yet implemented:
82-
83- - ` wrap ` construct for custom type conversions
84- - ` shared ` construct
85- - JSON adapters (` <json adapter.ocaml=...> ` )
86- - Open enums (` <json open_enum> ` )
87- - Biniou format (not planned)
88- - ` abstract ` types beyond the identity case
80+ See
81+ [ Issues] ( https://github.com/ahrefs/atd/issues?q=is%3Aissue%20state%3Aopen%20label%3Atarget%3Aocaml )
82+ for all open issues related to atdgen and atdml.
8983
9084Requirements
9185--
0 commit comments