From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 97DF2BC69 for ; Fri, 21 Dec 2007 04:38:04 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAEfDakfAXQImh2dsb2JhbACQBAEBAQgKKZgX X-IronPort-AV: E=Sophos;i="4.24,192,1196636400"; d="scan'208";a="5905374" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 21 Dec 2007 04:38:04 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id lBL3bxc7009845 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 21 Dec 2007 04:38:04 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAHDDakdA9hw0ZGdsb2JhbACPdphi X-IronPort-AV: E=Sophos;i="4.24,192,1196636400"; d="scan'208";a="5415661" Received: from tenhost.net ([64.246.28.52]) by mail2-smtp-roc.national.inria.fr with SMTP; 21 Dec 2007 04:37:59 +0100 Received: (qmail 29370 invoked from network); 20 Dec 2007 21:04:34 -0600 Received: from ip72-208-52-84.ph.ph.cox.net (HELO ?192.168.1.99?) (72.208.52.84) by tenhost.net with SMTP; 20 Dec 2007 21:04:34 -0600 Message-ID: <476B34E5.2060108@ramenlabs.com> Date: Thu, 20 Dec 2007 20:37:09 -0700 From: Dave Benjamin User-Agent: Mozilla-Thunderbird 2.0.0.6 (X11/20071009) MIME-Version: 1.0 To: Jon Harrop Cc: caml-list@inria.fr Subject: Re: [Caml-list] Easier FFI References: <200712201639.15513.jon@ffconsultancy.com> In-Reply-To: <200712201639.15513.jon@ffconsultancy.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 476B3517.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ffi:01 ffi:01 ocaml:01 bindings:01 ocaml:01 stubs:01 statically:01 wrote:01 caml-list:01 benjamin:01 python:03 python:03 external:03 library:03 library:03 Jon Harrop wrote: > For example, why can't we have a generic FFI library that allows us to use any > external library (unsafely) without leaving OCaml? Then we could write or > generate our bindings entirely in OCaml and forget about these C stubs. I would love something like this. I've used "ctypes", a similar library for Python, a few times, and it has really come in handy. Not something I want to use often (at least not directly), but for those times when use of an unsupported C library is necessary, it's so nice to have the ability to stay within the language rather than writing a bunch of wrapper code. I wonder if something like ctypes would translate well to a statically typed language like OCaml. http://starship.python.net/crew/theller/ctypes/