Cocoa Bindings

Joel Reymont <>
Sat Aug 26 23:02:52 CEST 2006


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