To my knowledge, nobody has contributed parsing of attributes and extensions (a change to the OCaml syntax whose use is central to many of the ppx extensions) to camlp4 or camlp5 (which implement their own OCaml parsers and thus need to be updated accordingly). It would not necessarily be too difficult to do so, but that means that currently you cannot combine camlp{4,5} and PPX extensions within the same source file. There is another way to understand your question: if you have developed camlp{4,5} extensions, how hard is it to port them to ppx, or conversely to port a ppx extension to camlp{4,5}? My answer would be "rather easy", knowing that there are two separate aspects: - The first thing an extension does is to parse some part of the user input to recognize extension-specific code. This is relatively easy to do using both systems, but done in a completely different ways, so this part (the "frontend") of the extension needs to be completely rewritten. In addition, ppx is more restricted than camlp{4,5} in terms of the flexibility to change the syntax (this is a feature), so some things that are easy to do for camlp{4,5} extensions may require some thoughts about how to express this with extensions/attributes instead. - Once the extension has recognized the information it relies on within the user source code, it will do some extension-specific stuff and spit some AST out. This is very easy to port from one extension to the other, and most of this part of the code (the "backend") can be reused. The respective size of frontend and backend differs depending on the extension. The more complex the frontend part, the harder the transition from one system to another (this also applies to porting an extension from camlp4 to camlp5 or vice-versa). On Mon, Oct 26, 2015 at 4:18 PM, Hendrik Boom wrote: > On Mon, Oct 26, 2015 at 02:27:23PM +0000, David Allsopp wrote: > > Hendrik Boom wrote: > > > On Mon, Oct 26, 2015 at 01:35:45PM +0000, Soegtrop, Michael wrote: > > > > Dear Ocaml Users, > > > > > > > > I just wanted to ask, if this is the right place to discuss camlp5, > or > > > if there is a better place. I have a rather bizarre build issue on > Cygwin > > > and a fix (well a hack) for it. > > > > > > Now I've heard about campl5, presumably a successor to campl4, and > about > > > ppx, touted as a successor to camlp4. > > > > In fact, camlp5 is technically the predecessor of camlp4! camlp4 was > incompatibly re-worked for OCaml 3.10 (I think it was 3.10, anyway) - > Daniel De Rauglaudre, the author of the original camlp4 but at that time > not its maintainer, decided to continue development of the original camlp4 > but, to avoid creating even more hell in the upgrade to OCaml 3.10, renamed > the tool to camlp5. So camlp5 is basically a maintained fork of an older > version of camlp4. > > > > ppx is a much more recent innovation designed to replace most uses of > both those tools. Which is at least part of the reason that camlp4 is no > longer included in mainline OCaml. > > > > > What gives here? > > > > History! And also that converting between camlp4/camlp5/ppx is > non-trivial. If doing something new, and you don't need to worry about > older OCamls, ppx is the way to go... > > How incomptible are they? I don't expect to be able to use ppx in > the place of camlp4 on camlp4 code, but is there any difficulty > combining legacy code written using camlp4 with new code written > using ppx? > > -- hendrik > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >