From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 597527EFCD for ; Fri, 17 Oct 2014 23:33:23 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of kennethadammiller@gmail.com) identity=pra; client-ip=209.85.214.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="kennethadammiller@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of kennethadammiller@gmail.com designates 209.85.214.175 as permitted sender) identity=mailfrom; client-ip=209.85.214.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="kennethadammiller@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ob0-f175.google.com) identity=helo; client-ip=209.85.214.175; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="postmaster@mail-ob0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApYBAJ6KQVTRVdavm2dsb2JhbABbhDkEgwLRDwKBDQcWAREBAQEBAQYLCwkULoQDAQEDARIRHQEbHgMBCwYFCzcCAiEBAREBBQEcGSKICAEDCQitHW6LMIFygxCIXQoZJw1nhUoBCxoBBQ6OC4I7gneBVAWbSIIRj0iEZRgphUohL4JLAQEB X-IPAS-Result: ApYBAJ6KQVTRVdavm2dsb2JhbABbhDkEgwLRDwKBDQcWAREBAQEBAQYLCwkULoQDAQEDARIRHQEbHgMBCwYFCzcCAiEBAREBBQEcGSKICAEDCQitHW6LMIFygxCIXQoZJw1nhUoBCxoBBQ6OC4I7gneBVAWbSIIRj0iEZRgphUohL4JLAQEB X-IronPort-AV: E=Sophos;i="5.04,741,1406584800"; d="scan'208";a="83679493" Received: from mail-ob0-f175.google.com ([209.85.214.175]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 17 Oct 2014 23:33:22 +0200 Received: by mail-ob0-f175.google.com with SMTP id wn1so1322988obc.20 for ; Fri, 17 Oct 2014 14:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=jAjbqOGgd36fkrneazhBh2un424pJHKjrpLvX3oOW90=; b=yCgDsmUGAEf/Fs4VjmNz3ouFiy2N6npgWvA36rNTHSs9cHfbeCfKiooggA7HXR905v UYirzrlO8noBO1oNEBUaLJZQDbUYJUBjF1TEIvEiFoz7LBWit2ibSajyp1ZjJQLF0RxK G55yRDQHRjQCW3T8OuETA1Q9Mv/LwhJwywoQlHDWEVR+CFiyAwaECcz1wYpxLLY60D0f 6kiBfqy7pMfkbWs6jLfDos5aSNv9LznenchWWAu/BWIRFfo3fsP7FBCZb43f9iKkB04n KhRcCMaL5jeP44GTYR/fEwGZaBgDIQnw/MkkO4R44wSkAfCF+BNyvBbmNpBrTJlnHYBa GJtw== MIME-Version: 1.0 X-Received: by 10.202.191.194 with SMTP id p185mr4121644oif.63.1413581600599; Fri, 17 Oct 2014 14:33:20 -0700 (PDT) Received: by 10.182.97.137 with HTTP; Fri, 17 Oct 2014 14:33:20 -0700 (PDT) In-Reply-To: References: Date: Fri, 17 Oct 2014 17:33:20 -0400 Message-ID: From: Kenneth Adam Miller To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=001a113d6a522a33c30505a51d8a Subject: Re: [Caml-list] Library recompilation with OCamljava --001a113d6a522a33c30505a51d8a Content-Type: text/plain; charset=UTF-8 So, after doing some more work, I think the answer to 2) is no/no. After looking more into piqi, I now just need to find a way to do protocol buffers based RPC to an ocaml service... Anybody know how to do that? On Thu, Oct 16, 2014 at 4:08 AM, Kenneth Adam Miller < kennethadammiller@gmail.com> wrote: > So, I'm attempting a large library recompile with ocamljava. It's pretty > audacious, because some people in my workplace are rather unwilling to > learn ocaml, yet a very well respected and needed library is authored in > it. Everyone knows java, so we hope very much to recompile the library just > with ocamljava. > > Two important things that make me nervous in pursuing this effort are: > > 1) once fully recompiled, will the library work in java as it did with > native/ocaml byte code? > > I've already started modifying the popular OCamlMakefile project to add a > java-byte-code target, and I've found that a threaded example is admitted > by the compiler produces an uncaught exception when run on the JVM... That > example may fall out of what the ocamljava docs has been safely implemented > under ocamljava, I'm not sure... > > 2) I've noticed that the rather large library that I need to compile, as > my final target, and aside from the toy targets I'm testing ocamljava with, > actually consumes some other C libraries and functions in it's dependency > path... > > This is difficult; the traditional OCamlMakefile builds traditional c > stubs to .o files, correctly compiled with ocamlc. But when put on the > ocamljava command line, but ocamljava doesn't know what to do about it. > Would there be any way that I can have support for this ocaml feature as > well, or facilitate some way to link in or enable ocaml code that calls > into C being compiled down to java? > > 3) What if the answer to 2) is no/no? > > If I can't use ocamljava, which is the most desired and elegant way, > allowing beautiful language inter-operation, how can I *best* facilitate > calls to the ocaml library? Is there a fast way to generate callbacks to > ocaml in java or any other language? It's very highly preferable not to > have to delegate back through the JNI due to type safety and fragility. > Alternatively, I looked at the OCaml library Restful, and wondered to > myself if there could be any kind of fast definition between ocaml types > and an exchange language, like json or something. Ideally, I'd like to be > able to generate a url per function in a very very simple declarative > manner, so that I can take ocaml libraries, and make them operate as a > service, where ocaml library functions correspond to URLs. > > --001a113d6a522a33c30505a51d8a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
So, after doing some more work, I think the answer to 2) i= s no/no. After looking more into piqi, I now just need to find a way to do = protocol buffers based RPC to an ocaml service...

Anybod= y know how to do that?

On Thu, Oct 16, 2014 at 4:08 AM, Kenneth Adam Miller <kennethadammiller@gmail.com> wrote:
So, I'm attempting a large library rec= ompile with ocamljava. It's pretty audacious, because some people in my= workplace are rather unwilling to learn ocaml, yet a very well respected a= nd needed library is authored in it. Everyone knows java, so we hope very m= uch to recompile the library just with ocamljava.=C2=A0

= Two important things that make me nervous in pursuing this effort are:

1) once fully recompiled, will the library work in jav= a as it did with native/ocaml byte code?
I've already started modif= ying the popular OCamlMakefile project to add a java-byte-code target, and = I've found that a threaded example is admitted by the compiler produces= an uncaught exception when run on the JVM... That example may fall out of = what the ocamljava docs has been safely implemented under ocamljava, I'= m not sure...

2) I've notic= ed that the rather large library that I need to compile, as my final target= , and aside from the toy targets I'm testing ocamljava with, actually c= onsumes some other C libraries and functions in it's dependency path...=
=
This is difficult; the traditional OCamlMakefile builds traditional c = stubs to .o files, correctly compiled with ocamlc. But when put on the ocam= ljava command line, but ocamljava doesn't know what to do about it. Wou= ld there be any way that I can have support for this ocaml feature as well,= or facilitate some way to link in or enable ocaml code that calls into C b= eing compiled down to java?=C2=A0

3) What = if the answer to 2) is no/no?
If I can't use ocamljava, which is th= e most desired and elegant way, allowing beautiful language inter-operation= , how can I best facilitate calls to the ocaml library? Is there a f= ast way to generate callbacks to ocaml in java or any other language? It= 9;s very highly preferable not to have to delegate back through the JNI due= to type safety and fragility. Alternatively, I looked at the OCaml library= Restful, and wondered to myself if there could be any kind of fast definit= ion between ocaml types and an exchange language, like json or something. I= deally, I'd like to be able to generate a url per function in a very ve= ry simple declarative manner, so that I can take ocaml libraries, and make = them operate as a service, where ocaml library functions correspond to URLs= .

--001a113d6a522a33c30505a51d8a--