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 5D6B67FF37 for ; Tue, 2 Aug 2016 06:02:22 +0200 (CEST) IronPort-PHdr: 9a23:l+0epBI3/bSL45a7+dmcpTZWNBhigK39O0sv0rFitYgUKPrxwZ3uMQTl6Ol3ixeRBMOAuqoC1LSd7P6ocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+kQsiN0Y/oiaibwN76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKKx8zGJsIk+PzV6nvp/jtM0rzyMFsPsk84tEUL7mV6U+V71RSjo8YE4v48i+nAPHQA3HzXwMGjEfiB5FBQPC/Dn1W57wtm3xse8ri3rSBtH/Ub1hAWfq1KxsUhK90Co= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=arlencox@gmail.com; spf=Pass smtp.mailfrom=arlencox@gmail.com; spf=None smtp.helo=postmaster@mail-yw0-f193.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of arlencox@gmail.com) identity=pra; client-ip=209.85.161.193; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="arlencox@gmail.com"; x-sender="arlencox@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of arlencox@gmail.com designates 209.85.161.193 as permitted sender) identity=mailfrom; client-ip=209.85.161.193; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="arlencox@gmail.com"; x-sender="arlencox@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-yw0-f193.google.com) identity=helo; client-ip=209.85.161.193; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="arlencox@gmail.com"; x-sender="postmaster@mail-yw0-f193.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BjAQCPGqBXf8GhVdFchRcGrVyNQYdNBzsRAQEBAQEBAQERAQEJCwsJFzGCMhaCLxEdARseAxIQDwImAiQBEQEFAVAHh3QBAxehD4IHgTI+MYs7gWqCWgWGVQoZJw1Ug2kCBhBxhSmJWYI1gloFmTOOf48/Yo4GEh6BDzSBYQyCSSAyh2wBAQE X-IPAS-Result: A0BjAQCPGqBXf8GhVdFchRcGrVyNQYdNBzsRAQEBAQEBAQERAQEJCwsJFzGCMhaCLxEdARseAxIQDwImAiQBEQEFAVAHh3QBAxehD4IHgTI+MYs7gWqCWgWGVQoZJw1Ug2kCBhBxhSmJWYI1gloFmTOOf48/Yo4GEh6BDzSBYQyCSSAyh2wBAQE X-IronPort-AV: E=Sophos;i="5.28,458,1464645600"; d="scan'208";a="186616001" Received: from mail-yw0-f193.google.com ([209.85.161.193]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 02 Aug 2016 06:02:21 +0200 Received: by mail-yw0-f193.google.com with SMTP id u134so14045076ywg.3 for ; Mon, 01 Aug 2016 21:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=QcD+6ggApKNwgoiKmlB3ayv4BGaC/vh87PsJA/0XMtw=; b=qXCfo1D8c/4BQdtrx8+Jk1j7SdqqYJYHjNTUcbo6LtqNGUmUolQcIpWGNOfum65Os5 iJ7kr/nw+zFrnRahsLgzS2RZbDCId4OhxwPCFxpQkhAjObn8cM8zH87eWK/M4QKGDfFy OZIuKtkmO9xBd8VCotT7mZdCW4DXKhsuL9Xdgm1dmAVzhambd0qUqdgmiWYpXN1ortVM yk76xLoxLCQRxQvr6GdAxPwk06PoSpoq5npan9ktQ/B27dpGaxucZ4KZGrznP1zAAB3X tWF2+XHPD7t98Kjqj7RPJ41bWt80TbL6BRCu2KjZuMvMu12ZMZ12PWCwHtQClO5ujAVn yLYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=QcD+6ggApKNwgoiKmlB3ayv4BGaC/vh87PsJA/0XMtw=; b=FRYucQInX2GJokmW6SEBPxGtyRkIAcASo+5aILUILk39Pw0zk7TjT2BTk2TDRrHOYd yiEV2k/eT5KSBtlSJJPrKqyImaj2BqCjfpPAZs95HHtEL58P10URk9vc17WZjWQKuH3g FLOOxRbXmymZfou3k07/oNRNRFQNkL3RdLBicHppT8SYo9IewVdQmHYZPJXnwT0uY9Jz PTNi3jIXLI+H8nCE9FYJDq99ijEKZuEAwRK+XKKb1xpmdDj+LRwqoqjNg57XZlgZdOQO ozEIIT8wPrl7ggbeLRNtCqsOpqnoqVKY7oHY77QkFwo7EviG9Rj5wM5qJTqOznU34mw/ QAeQ== X-Gm-Message-State: AEkoout9mmRK7kT7TLTX1tSV9opAtHx9QwaAORlDgkxIpjIBEKgYvrtcx3QNFjDliSIx3XUppPkyGhC9UvPVCw== X-Received: by 10.129.115.4 with SMTP id o4mr46345795ywc.312.1470110539843; Mon, 01 Aug 2016 21:02:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.117.136 with HTTP; Mon, 1 Aug 2016 21:02:19 -0700 (PDT) From: Arlen Cox Date: Tue, 2 Aug 2016 00:02:19 -0400 Message-ID: To: caml-list@inria.fr Content-Type: text/plain; charset=UTF-8 Subject: [Caml-list] Make OCaml library available to Java Hi all, I'm trying to figure out what the best way is to make an OCaml library available to a Java program. I can think of several ways to do this each with pros and cons: 1. OCaml-Java: This is the most obvious solution that translates the OCaml code directly to Java. + Simple interface to OCaml code + Portable Java-compatible code + Can easily call back into Java - OCaml-Java is a bit buggy - Code runs slower 2. js_of_ocaml: Translate OCaml to JavaScript and then use the new "fast" JavaScript engine in Java 8 to execute the JS. + Portable Java-compatible code + Can call back into Java (albeit, less easily than OCaml-Java) - Not type safe interface - Possible massive slowdowns or at least unpredictable performance 3. JNI with C Library: Wrap OCaml code in a C library and then call into that with JNI + Native OCaml performance - Complex GC interaction - Not type safe - Not portable (need different .so for each platform) - No tools to help in doing this (CamlJava is both unsupported and seemingly unidirectional) - No easy call back into Java Does anyone have any experience with doing this or have any suggestions on what to do in this situation? Thanks, Arlen