-
Notifications
You must be signed in to change notification settings - Fork 46
dev meeting 20210224
Present at the meeting:
- James Somers (@jsomers)
- Guillaume Petiot (@gpetiot)
- Nathan Rebours (@NathanReb)
- Guillaume works on ocamlformat's RPC and formatting of ocaml blocks in MDX
Nathan worked on dropping the dependency on omp in MDX. We didn't even need to use ppxlib in the end, our own compat layer works better given the parts of compiler-libs that we use. This has now been released, allowing JaneStreet to upgrade ppxlib internally while still using MDX.
Guillaume worked on the formatting of OCaml toplevel blocks using ocamlformat's RPC and gave us a demo. MDX uses an ocamlformat RPC client library (which doesn't depend on ocamlformat itself) to talk to the ocamlformat RPC daemon. At the moment it starts the daemon itself if it can't find a running instance. Before printing the corrected blocks, it sends the phrases to be formatted using the RPC and gets a formatted phrase back. This formatted phrase ends up in the corrected file, promoting it results in a properly formatted mdx file.
There are a few things left to do to reach a MVP:
- At the moment we still need some quick and dirty fixes to refine the output a bit and keep it MDX friendly. For example we need to preprocess the formatted phrase because of how ocamlformat deals with
;;
by default. - No configuration can be passed to the daemon so it always formats using the default profile, we'll need to improve that. It will probably be the responsiblity of whoever starts the daemon to point it to the right configuration.
- We need to add support for "regular" OCaml blocks and for blocks in mli files.
There are still things to consider on the ocamlformat side before the RPC gets merged so we should make sure we have a clear plan on the MDX size as well to avoid unwanted back and forth modifications between MDX and ocamlformat.