Version française
Home     About     Download     Resources     Contact us    
Browse thread
Generation of Java code from OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin.jambon@e...>
Subject: Re: [Caml-list] Generation of Java code from OCaml
blue storm wrote:
> On Thu, Sep 24, 2009 at 1:18 PM, Martin Jambon
> <martin.jambon@ens-lyon.org> wrote:
>> Yes, patching the original code of json-static would work but it's not ideal.
> 
>>From the example given, it seems that the original poster already uses
> json-static. In that case, I think that reusing the code logic is a
> good idea (coherent behaviour, etc.). I suppose that you dislike the
> "patching" solution as it is not easily reusable (one cannot use the
> upstream json-static anymore).

Of course, the internals of json-static are much more likely to change than
its user interface.  This may however not be such a big problem here in practice.

The problem is more that it's not compatible with other possible extensions of
json-static provided by 3rd parties.

> What about factorising json-static to allow adding arbitrary code
> generators (represented as functions from (string * type_def) list to
> a camlp4 Ast) at camlp4-time ? You would have a design similar to
> type-conv, wich allows adding new generators without modifying
> type-conv itself.

Oh yes, there's type-conv too.  I don't know the pros and cons of using either
type-conv or deriving.  If anyone knows, a brief comparison would be helpful.


Martin

-- 
http://mjambon.com/