Cocoa Bindings

Daniel Goertzen <>
Sun Aug 27 15:48:48 CEST 2006


I recently came to same conclusion while exploring qt4 bindings for 
erlang.  Sure, I could make bindings to cover much of the simple stuff, 
but the corner cases got out of control very quickly.  What was I really 
trying to accomplish?  Gui programming with qt4 in c++ is actually 
pretty slick, so why fight it.

Cheers,
Dan.

Joel Reymont wrote:
> The more I think about the idea of Cocoa Bindings for Erlang the more 
> it does not make sense to me. I got my Cocoa app to connect to the 
> Erlang VM and recognize when data is available to be read. This is 
> very simple, actually.
>
> The main issue is all the heavy-duty marshalling that needs to be done 
> for every Cocoa/ObjC call. Not only do you need to extract data from 
> Erlang terms but also build NSInvocation objects to execute the call 
> and allocate memory to grab the results.
>
> With other languages you can just pass pointers around but, obviously, 
> you cannot do this over sockets. Then there's the matter of executing 
> calls like
>
> [[[NSFileHandle alloc] initWithFileDescriptor:fd closeOnDealloc:YES] 
> autorelease]
>
> where you need to compose a bunch of functions and run each on the 
> results of the previous one. Yes,  you can send something like this to 
> the C node
>
> [{'NSFileHandle', alloc}, ['initWithFileDescriptor:', Fd, 
> {'closeOnDealloc', 'YES'}]]
>
> but I wonder what is the point? The GUI can be built with much ease in 
> XCode and only domain-specific and optimized messages can be sent 
> between the Cocoa node and the Erlang. This gets one the best of both 
> worlds, in my opinion.
>
> What do you think?
>
>     Thanks, Joel
>
> -- 
> http://wagerlabs.com/
>
>
>
>
>
>




More information about the erlang-questions mailing list