[squeak-dev] Re: [smalltalk-research] Re: [Esug-list] Google Summer Of Code 2010 news!!!

Gilad Bracha gilad at bracha.org
Mon Mar 8 15:07:49 UTC 2010

Hi Paolo,

On Mar 7, 2010, at 11:52 PM, Paolo Bonzini wrote:

> BTW, I took a look at Aliens and it would be possible to port CObject
> to Squeak basing it on Aliens, since it provides a higher-level
> framework.  

"It" is ambiguous here.  From what I could see,  CObjects already has some facilities for automagically deriving bindings from C headers, and in that sense is higher level. While Newspeak has a fair amount of C parsing code, we never got around to adding such auto-magic. We started at the low level because of the considerations Andres mentioned. I believe we could solve them, but it probably goes beyond a SoC project.

On the other hand, the big advantage of aliens is that they do not require a special primitive-like  syntactic construct. The Alien implementation itself requires a primitive, but you don't need special syntax to use aliens.  Aliens are a better fit with security, though this is probably immaterial to this discussion.

For a discussion of these issues, please see 


(a slightly related discussion of primitives in general is at http://gbracha.blogspot.com/2008/08/foreign-functions-vm-primitives-and.html)

> Gilad, in your experience what % of the bindings you wrote were
> Smalltalk and what % was C code?  

I'm not sure I understand the question.  All our FFI bindings are done the same way, using aliens. No C code is involved - but you do need an intimate understanding of the foreign data representation (how many bytes, basically).

> Did you have any performance
> problems that you could fix using more C code?

I assume you are referring to usages of the FFI (I have lots of Smalltalk/Newspeak code that runs slower than C  :-) ).

Performance of the FFI has not been an issue. We have a native Windows GUI built upon using aliens, so things get exercised pretty thoroughly. Of course, there is some overhead to using an FFI, and it could perhaps be further improved. I'll let Eliot comment on that if he wants to.

Cheers, Gilad

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100308/03a12b25/attachment.htm

More information about the Squeak-dev mailing list