English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
OCaml && COCOA-Environment (Mac-OS-X/GUI)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-23 (00:12)
From: Jacques Garrigue <garrigue@m...>
Subject: Re: [Caml-list] OCaml && COCOA-Environment (Mac-OS-X/GUI)
From: "William D.Neumann" <wneumann@cs.unm.edu>
> Have any of you taken a look at the work done for the Haskell to 
> Objective-C Binding <http://hoc.sourceforge.net/>.  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.


Jacques Garrigue