caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Paul Snively <psnively@mac.com>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: wneumann@cs.unm.edu, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] OCaml && COCOA-Environment (Mac-OS-X/GUI)
Date: Thu, 24 Feb 2005 12:40:46 -0800	[thread overview]
Message-ID: <f7bf2978035dafdbf73334a778a45ed8@mac.com> (raw)
In-Reply-To: <20050223.091230.88701909.garrigue@math.nagoya-u.ac.jp>

-----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-----


  reply	other threads:[~2005-02-24 20:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-05  0:02 Oliver Bandel
2005-02-05 16:37 ` [Caml-list] " Julien Roussel
2005-02-05 19:51   ` Mike Hamburg
2005-02-06 21:04     ` Paul Snively
2005-02-07  2:24       ` Oliver Bandel
2005-02-09 19:41         ` Mike Hamburg
2005-02-17  7:12       ` Jeff Henrikson
2005-02-18 23:41         ` [Caml-list] " art yerkes
2005-02-25  2:03         ` Paul Snively
2005-02-25  9:13           ` Oliver Bandel
2005-02-26  1:19             ` [Caml-list] " Sachin Shah
2005-03-01  6:39           ` Jeff Henrikson
2005-03-07  5:20             ` Paul Snively
2005-02-22  2:45     ` [Caml-list] " William D.Neumann
2005-02-23  0:12       ` Jacques Garrigue
2005-02-24 20:40         ` Paul Snively [this message]
2005-02-24 23:21           ` Oliver Bandel
2005-02-25 17:20             ` Mostly OT: Apple and Language Adoption was " Paul Snively
2005-02-22 10:54     ` Oliver Bandel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7bf2978035dafdbf73334a778a45ed8@mac.com \
    --to=psnively@mac.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    --cc=wneumann@cs.unm.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).