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: Till Varoquaux <till.varoquaux@g...>
Subject: Re: [Caml-list] Deriving + type-conv + OCaml-Templates + camlp4* = ?
type-conv in itself just puts the base down to be a common plate for
type converter. The main reason for its inception was to avoid
conflicts between different camlp4 extensions that  scaffold types
(e.g. sexp), it does not dispense from writing all that gruesome
camlp4 code (this is in no way a critizisme of Nicolas work, hats off
to both him and Daniel De Raugladre for the sheer amount of work they
have done). Markus Mottl would be able to tell you more.

I have not tried Deriving so I am not able to say much about it. I can
however point out two approaches I have been involved in:
_We (jane street) have recently been experimenting with a Camlp4
extension that automatically projects to and from universal types. It
is still in its infancy but seems quite promising (disclaimer: I am
the main author of the extention). Since this is such an amazing
exciting, revolutionary, ground-breaking etc... project (what kind of
monster would say his newborn is ugly) I will preceed the question
that is bound to arise: why is not open sourced?
   1) It is not my decision to make (this is not as big of an issue as
it might seem)
   2) Releasing bad code would hurt our credibility and give a bad
image. Documenting and polishing this extension is a lot more work
that what meets the eyes (Pareto principle....)
   3) The code in our system is deeply intertwined doing a clean
separation whilst not introducing artificial problems or code
duplication is yet again an additional burden.
I am fairly confident that if 2 and 3 are solved 1 will not be much of
an issue. Of course this is a pie in the sky.
_I have been toying with recursive modules, polymorphic variants and
Camlp4 to build a toy layered compiler. The code is a nice proof of
concept, but, as previously, does not address any of the exotic cases
of the long trail (nor does it have proper documentation or error
reporting). If you are not scared of having a bumping ride it can be
browsed online at:
http://till.varoquaux.free.fr/projects/janus/

Now I feel I should give credit (and disclaimers) where due:
_I am currently the only person using the first extension. I am fixing
it when it breaks down it is not used in critical production code.Do
not be under the impression that the code at Jane Street is not
carefully peer reviewed. This work was based on work by David  Powers
and others. As always my statements are purely personnel and do not
reflect the views of my employer (although I do not think I am parting
much with them).
_Jerome Vouillon, Vincent Balat counseled me and guided (err..
suffered) me through the creation of Janus. I should be held
responsible for the sorry state it is in, but they are to be praised
for the little that has been made. Jacques Garrigue was also of great
help, not to mention I stole most of my ideas from his articles.

Till

On Tue, Feb 26, 2008 at 8:27 PM, David Teller <David.Teller@ens-lyon.org> wrote:
>     Dear list,
>
>   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 ?
>
>  Cheers,
>   David
>
>  --
>  David Teller
>   Security of Distributed Systems
>   http://www.univ-orleans.fr/lifo/Members/David.Teller
>   Angry researcher: French Universities need reforms, but the LRU act brings liquidations.
>
>  _______________________________________________
>  Caml-list mailing list. Subscription management:
>  http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
>  Archives: http://caml.inria.fr
>  Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>  Bug reports: http://caml.inria.fr/bin/caml-bugs
>



-- 
http://till-varoquaux.blogspot.com/