From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id AEF03BC75 for ; Wed, 23 Feb 2005 01:12:40 +0100 (CET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j1N0Cc1f007764 for ; Wed, 23 Feb 2005 01:12:40 +0100 Received: from localhost (suiren [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.13.1/8.13.1) with ESMTP id j1N0CX5K014604; Wed, 23 Feb 2005 09:12:34 +0900 (JST) Date: Wed, 23 Feb 2005 09:12:30 +0900 (JST) Message-Id: <20050223.091230.88701909.garrigue@math.nagoya-u.ac.jp> To: wneumann@cs.unm.edu Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] OCaml && COCOA-Environment (Mac-OS-X/GUI) From: Jacques Garrigue In-Reply-To: <90118fcfddc239a0e5c9d949c5b39c42@cs.unm.edu> References: <3a2f4a1305020508377ec6ddaf@mail.gmail.com> <90118fcfddc239a0e5c9d949c5b39c42@cs.unm.edu> X-Mailer: Mew version 4.1.53 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 421BCA76.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 haskell:01 sourceforge:01 compiler:01 haskell:01 syntax:01 binary:01 binary:01 ocaml:01 runtime:01 cheers:01 ...:98 cocoa:98 syntactic:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: From: "William D.Neumann" > Have any of you taken a look at the work done for the Haskell to > Objective-C Binding . It seems to be a > bit stagnant, but they may have some insight to offer... This actually looks pretty impressive. And it isn't really stagnant: their approach is to generate everything automatically, so once it works, there are not many changes left to do. Yet they could do with a bit more documentation (but I shouldn't be the one to say so :-) So they have this wonderful interface compiler, which slurps all the objective C headers, and produces a strongly typed Haskell interface. With a bit of syntactic sugar, you end up with something you can actually write in; actually you write objective C with haskell syntax, which is a bit weird, but works. Of course, there is a catch: the generated interface is huge. So you end up with this 172-line haskell application (a simple editor), which compiles to a 11MB binary (not including the gnustep/cocoa shared libraries). The binary libraries (*.a) they install sum up to a whooping 33MB! I suppose the same kind of integration could be done with ocaml. In particular Objective C is dynamic enough that you can do lots of things with a tiny runtime support, and then introduce all your types. The problem is that it's not clear whether it would match nicely with the ocaml object system. Cheers, Jacques Garrigue