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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id B5F3FBC6B for ; Sun, 28 Oct 2007 16:38:55 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPJJJEdA6ba/mGdsb2JhbACOYwIBAQcEBCs X-IronPort-AV: E=Sophos;i="4.21,338,1188770400"; d="scan'208";a="18701296" Received: from nf-out-0910.google.com ([64.233.182.191]) by mail4-smtp-sop.national.inria.fr with ESMTP; 28 Oct 2007 16:38:55 +0100 Received: by nf-out-0910.google.com with SMTP id e27so971466nfd for ; Sun, 28 Oct 2007 08:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; bh=x6b7G0PNgkUWfy3haOniGOh/p2v5gaAgIP13xVIFYxA=; b=m8SlNitNb4XGT8EMj3gqMELIS7E6Z0iJ19F2oXVDDjhFiGx3Zt2BvvcEvsdwGDBvuKMZ400bwFOTaO9rEVq0MzHgxUAkNH/PTXjj3HOGzJe9RD5u7xY3aoJCk/M5pF87EzwqL29xO5+fGjRrfvao7QwWgOrF5kDBYEeA2rxxLfg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; b=kN4ohE/VsvTrQLU+VX9OTU2qiJW0T9jOFAlHDJqtAhxaSesAu57G8nTY1AP4XJkgB2I7qHwrV6TyYYNGux7QKqHLXlSkvPsHr1p4PFUbuBjB9Hk9XgLDMwti89UQLuWDoPd4GMY+UvzpMyuGFovncPk7zl7wSoyPqgso4x8pRxU= Received: by 10.86.79.19 with SMTP id c19mr4014001fgb.1193585934714; Sun, 28 Oct 2007 08:38:54 -0700 (PDT) Received: from ?192.168.0.12? ( [82.235.58.110]) by mx.google.com with ESMTPS id u9sm11844698muf.2007.10.28.08.38.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 28 Oct 2007 08:38:53 -0700 (PDT) Subject: Re: [Caml-list] OCaml/C interface From: David Teller To: Christopher L Conway Cc: caml-list@yquem.inria.fr In-Reply-To: <4a051d930710280648t72075b40r13d7a0fa225caece@mail.gmail.com> References: <20071026091806.GA10054@localhost> <1193575003.6383.19.camel@Blefuscu> <4a051d930710280648t72075b40r13d7a0fa225caece@mail.gmail.com> Content-Type: text/plain Date: Sun, 28 Oct 2007 16:39:00 +0100 Message-Id: <1193585941.6383.31.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit Sender: David Teller X-Spam: no; 0.00; ocaml:01 ens-lyon:01 cheers:01 swig:01 swig:01 ocaml:01 abstraction:01 untyped:01 wrote:01 caml-list:01 binding:02 library:03 problem:05 chris:06 interface:06 Interesting, thanks. Cheers, David On Sun, 2007-10-28 at 09:48 -0400, Christopher L Conway wrote: > This is very similar to what you would get from SWIG > (http://www.swig.org/, OCaml support is in SVN): it generates a > binding where each C function has type c_obj -> c_obj, where c_obj is > more or less your c_type. Basically, this just hoists the problem up > one level of abstraction, so that instead of writing C code using > mltypes.h, you write OCaml code that massages effectively untyped > values coming out of the library. > > Regards, > Chris