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 CA270BC75 for ; Thu, 24 Feb 2005 21:41:29 +0100 (CET) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.85]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j1OKfIjH015865 for ; Thu, 24 Feb 2005 21:41:29 +0100 Received: from mac.com (smtpin08-en2 [10.13.10.153]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id j1OKexQw002417; Thu, 24 Feb 2005 12:40:59 -0800 (PST) Received: from [192.168.1.100] (dsl092-032-215.lax1.dsl.speakeasy.net [66.92.32.215]) (authenticated bits=0) by mac.com (Xserve/smtpin08/MantshX 4.0) with ESMTP id j1OKevDk014429; Thu, 24 Feb 2005 12:40:58 -0800 (PST) In-Reply-To: <20050223.091230.88701909.garrigue@math.nagoya-u.ac.jp> References: <3a2f4a1305020508377ec6ddaf@mail.gmail.com> <90118fcfddc239a0e5c9d949c5b39c42@cs.unm.edu> <20050223.091230.88701909.garrigue@math.nagoya-u.ac.jp> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: wneumann@cs.unm.edu, caml-list@yquem.inria.fr From: Paul Snively Subject: Re: [Caml-list] OCaml && COCOA-Environment (Mac-OS-X/GUI) Date: Thu, 24 Feb 2005 12:40:46 -0800 To: Jacques Garrigue X-Pgp-Agent: GPGMail 1.0.2 X-Mailer: Apple Mail (2.619.2) X-Spam: no; 0.00; caml-list:01 ocaml:01 hash:01 wrote:01 compiler:01 haskell:01 haskell:01 syntax:01 annotations:01 revise:01 annotations:01 o'caml:01 wrappers:01 minor:01 binary: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: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Feb 22, 2005, at 4:12 PM, Jacques Garrigue wrote: > 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. > This is exactly what I have in mind: take advantage of Forklift's external annotations to header files. So: revise Forklift to parse Objective-C headers, write (external) annotations to Apple's headers, and use Forklift to generate the O'Caml wrappers. Indeed, part of the point is very much to end up in a position where changes Apple makes to the headers necessitate hopefully minor revisions to the annotations and an automated regeneration. > 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! > Ouch! Is there no dead-code stripping? > 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. > Mike Hamburg got some distance with his runtime library, which naturally relied on Obj.magic. It seemed relatively tight and elegant, but of course he's since commented on some runtime overhead concerns that, IIRC, he believes might be ameliorated by having better type information, which presumably would come from the FFI. So we seem to be at something of a Catch-22, at least until some concrete progress on deriving type information via an FFI is accomplished. I note with interest Jeff Henrikson's comments and regret that I have not yet had sufficient time to investigate them beyond reading them. Hopefully this weekend will provide some time to follow up. > Cheers, > > Jacques Garrigue > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > Best regards, Paul -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Darwin) iEYEARECAAYFAkIeO9cACgkQO3fYpochAqJttQCgyWwDtq8zJbp4iAGNkyDWQIOL IQ4An2fV2lQezGjzgjVdfvUBkrOB8q83 =1S2R -----END PGP SIGNATURE-----