<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.6.2">
</HEAD>
<BODY>
Marc/Jason<BR>
<BR>
I haven't yet looked at Jason's work, BUT... I did scratch a bit at Python<->ObjC.<BR>
<BR>
The general approach there is to use a dynamic call library. libffi seems to be the one of (current) choice, although my direct experience is with libffcall (from Bruno Hable's CLISP). libffi supports everything from 386 and embedded through to S390, I've started playing around with the library; the ObjC stuff is basically C call convention, and is directly supported. I'll try to wire in libffi in a reasonable way (always, depends on my time and availability). Right now, all I can say is that I like ffcall a bit more -- but it appears "crusty",<BR>
<BR>
If wired in correctly, this should provide not only an ObjC bridge, but a way to build dynamic links to Linux/Unix shared objects (dlopen/dlsym and then build a trampoline to the C function through libffi). Of course if binding C libraries directly, it is just as easy to generate the glue code statically from a description, but using libffi should allow lifting of the "hard bits" from Python.<BR>
<BR>
Still scratching.<BR>
<BR>
Fred Weigel<BR>
<BR>
On Wed, 2013-02-27 at 10:29 -0500, Marc Feeley wrote:<FONT COLOR="#737373">></FONT><BR>
<FONT COLOR="#737373"> I'd be happy to unblackhole mine if it gets more people involved.</FONT>
<BLOCKQUOTE TYPE=CITE>
<PRE>

<FONT COLOR="#737373">> The x86_64 part is because ObjC doesn't provide a completely machine-abstract way to invoke dynamically.  Each way has some icky flaws.  My first goal was actually iOS, but I went down the x86_64 path because Mikael had a need for that first.  I'd like the package to have x86_64/i386/arm.</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> I did discover that a LOT more machinery is needed for x86_64 than for i386 or arm.  Calling conventions on 64-bit are crazy insane (though I now have the worst of it solved).</FONT>

I agree that there are issues with all approaches.  If possible I'd like to avoid using assembly language which is compiler and operating system dependent (Objective-C runs on other platforms than iOS and OS X).

I wonder if there are some ideas we can steal from the Python Objective-C bridge:

  <A HREF="http://pythonhosted.org/pyobjc/">http://pythonhosted.org/pyobjc/</A>

Marc

_______________________________________________
Gambit-list mailing list
<A HREF="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</A>
<A HREF="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</A>

</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>