Version française
Home     About     Download     Resources     Contact us    
Browse thread
Deriving + type-conv + OCaml-Templates + camlp4* = ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <markus.mottl@g...>
Subject: Re: [Caml-list] Deriving + type-conv + OCaml-Templates + camlp4* = ?
On Tue, Feb 26, 2008 at 3:27 PM, David Teller <David.Teller@ens-lyon.org> wrote:
>   Browsing around the net, I've found three
>  "scrap-your-boilerplate"-style projects for OCaml: the simple Type-conv,
>  the ambitious Deriving and the unmaintained OCaml-Templates, and of
>  course the ability to use camlp4/camlp5 for the same purpose. I imagine
>  that there are a number of nice boilerplate-based modules just waiting
>  to be implemented or adopted.
>
>   As far as I understand, there's no interaction between the project
>  authors, which is a shame. So this is an open call to whoever is in
>  charge of each work: do you think it would be possible for you all to
>  join forces and produce something robust, simple and possible to adopt
>  as a standard ?

I think that different projects have different trade-offs that are
hard, if not impossible, to combine.  Deriving is a very elegant,
general approach, but last time I checked it would be hard to generate
highly optimized code with it, and it was also not complete (e.g.
handling hard cases like polymorphic variants with inherited types,
etc.).  Type-conv was mostly factored out of sexplib to make it
possible to have different type converters in different preprocessors,
because we are planning to release our binary protocol library very
soon.  Type-conv only combines a few often needed constructs, but in
my experience the very vast part of new type converters has to be
written by hand anyway (at least if you care about performance / good
code generation) so there is little to gain here.  I don't know much
about OCaml-Templates.

Regards,
Markus

-- 
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com