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: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Generation of Java code from OCaml
On Wed, Sep 23, 2009 at 09:15:08PM +0300, Mykola Stryebkov wrote:
> I need to generate arbitrary text (more specifically, Java code) from  
> Ocaml structures, pretty similar to how json-static lib generates  
> ocaml code from ocaml structures.
> 
> Which approach would you recommend?
> Is it possible to use ocamlp4 for it?

Do you want to generate valid Java code (or an AST) or just string
bits of text together?

FWIW we generate 100's of thousands of lines of C, Java and other
languages using OCaml in libguestfs (by stringing bits of text
together):

http://git.et.redhat.com/?p=libguestfs.git;a=blob;f=src/generator.ml;hb=HEAD

Rich.

-- 
Richard Jones
Red Hat