[ANN] MessageCapture

Michael van der Gulik squeakml at gulik.co.nz
Mon Oct 16 08:32:10 UTC 2006


Bert Freudenberg wrote:
> Am 15.10.2006 um 08:56 schrieb Michael van der Gulik:
> 
>> I've been using a class called "MessageCapture" which lets you  
>> receive messages sent to an object. It's caused me no end of agony  
>> trying to get it working, so I thought I'd share my agony with the  
>> community :-P.
>>
>> Source code here: http://www.squeaksource.com/DPON.html - click on  
>> "latest", MessageCapture-mvdg.2.mcz.
>>
>> It's released under the.. umm... MIT license.
>>
>> Also included is a Future class, which lets you do things like:
>>
>> result := Future doing: [ some long computation ].
>>
>> This will return immediately, forking off a process to do the  
>> computation and replacing "result" with the result when it's finished.
>>
>> Some of the tests fail. Any hints / tips / guidance is very  welcome! 
>> Especially as to how to capture #== and #class. Those two  messages 
>> are sent by the interpreter even before doing a message  lookup.
> 
> 
> You might want to look at how this is handled in Croquet (MIT  licensed, 
> too). As you know (or maybe not) Croquet is not foremost  about 3D but 
> about distributed computing with capability-based  security. The 
> messaging infrastructure with future sends, returned  promises etc. is 
> independent of the UI.
> 
> Now the current implementation does not yet provide water-tight  
> security, but the principles are there and it's surely worth having a  
> look.

Correct me if I'm wrong, but I think Croquet uses pretty normal objects 
for what it does. Objects are grouped together, and inter-group 
references are done using FarRef objects. I think it completely avoids 
the problem of capturing references - arguably a more stable approach 
than what I'm doing.

Can anybody confirm this?

I'm aware that Spoon and Magma also do message capture. I like Spoon's 
approach best: modify the VM.

Michael.




More information about the Squeak-dev mailing list