Skip to content

Templater comparison

Anton Bachin edited this page Oct 17, 2024 · 2 revisions
eml mlx TyXML TyXML
let%html
dream-html
Syntax style HTML HTML OCaml HTML OCaml
Data type string AST AST AST AST
Tag
balance
Unchecked Yes
mlx
Yes
(OCaml)
Yes
(Markup.ml)
Yes
(OCaml)
Validation No No ? Partial
(OCaml)
Partial
(OCaml,
Markup.ml)
No ?
Escaping Yes Yes Yes Yes Yes
VSCode
support
No No Yes
(OCaml)
No Yes
(OCaml)
Dune
boilerplate
dune-project dune-project dune dune dune
Learning
curve
Syntax
interaction
JSX quirks Polymorphic
variants
Low ? Low ?
Difference
with HTML
0 JSX quirks OCaml Low OCaml
Implementation Simple
parser
Dialect+PPX OCaml Markup.ml+PPX OCaml

This resurrects #1181 by @gpetiot which stalled, as I understand it, due to a lack of

Rows omitted:

  • Composability: all of these are composable through OCaml's own composition mechanisms.
  • Control flow: all of these depend on OCaml control flow. With eml, the syntax for interleaving templates with control flow can be unclear.
  • Emitted whitespace: haven't checked, but I would expect only eml emits lots of spurious whitespace, as is typical for a string-based approach.

Potential things to consider: performance, debugging, testing, coverage, docs.

Clone this wiki locally