# mlx

A syntax dialect that adds JSX-style expressions to OCaml, compiling them into plain OCaml function calls through a preprocessor.

mlx extends OCaml's syntax with JSX-like markup, letting a function build a tree of elements with tag-like syntax instead of nested function calls. A preprocessor, mlx-pp, transforms .mlx files into ordinary OCaml source, which a runtime library or a ppx then turns into the desired output, for example HTML generation or a UI framework's element tree.

Dune projects opt in by declaring an mlx dialect that routes .mlx files through the preprocessor and configures Merlin so editor tooling still works. Editor support is available for VS Code, Neovim and Emacs, with syntax highlighting and, in VS Code, the same language-server features as ordinary .ml files.

The project is written in OCaml and distributed as opam packages.

Website: https://github.com/ocaml-mlx/mlx
