BER MetaOCaml for OCaml 5.0?

Hi! I wonder if anyone is looking into bringing BER MetaOCaml up to OCaml 5.0? With the excellent work by Oleg Kiselyov, this does not seem daunting.

My thinking is we could use the opportunity to give up on the non-standard syntax. We could use a library-level ppx extension, plus a source-level preprocessor for backward compatibility, for example:

  • .< expression >. -source-pp-> [%code expression] -ppx-> (expression)[@metaocaml.bracket]
  • .~( expression) -source-pp-> [%meta expression] -ppx-> (expression)[@metaocaml.escape]
  • .~identifier -source-pp-> ~#identifier -ppx-> identifier[@metaocaml.escape]
3 Likes

It was proposed to include the metaocaml syntax into OCaml.

But maybe there is some independent resistance to introducing the MetaOCaml syntax (e.g. if it introduces exceptions to OCaml’s syntax principles, or conflicts with operators in existing code bases). Personally, I find the extension points [%code ...], [%meta ...] concise and readable enough, while (...)[@metaocaml.bracket] and (...)[@metaocaml.escape] would definitely be a show-stopper.