On Wed, Jan 21, 2009 at 3:09 PM, Yoann Padioleau <padator@wanadoo.fr> wrote:

Moreover, sometimes you need to do things slightly differently
from what is auto-generated and it becomes painful. For instance
it's possible to auto-generate the string_of_xxx for each
type xxx, but at some point you may want to do the printing
slightly differently, hide a few things, do some indentation
work (and use the Format library), etc, and at this point
you will have to write the tedious code. Camlp4
metaprogramming may save you some time at the beginning, but but do you really
win that much time in the end ?

Yes!

Sexplib is entirely an exercise in camlp4 metaprogramming, and it has saved us countless hours of work and simplified our lives greatly.  Yes, if you need lots of variations on your serialization and deserialization functions then camlp4 is a painful way of going about it.  But things like sexplib act as general language extensions which can provide broadly useful functionality at a low cost.  I really think it's a very big win.

y