Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
March 2016
- 716 messages
Re: [Pharo-dev] [Ann] New version of Ghost
by Denis Kudriashov
2016-03-24 19:15 GMT+01:00 phil(a)highoctane.be <phil(a)highoctane.be>:
> Awesome. Things are looking good.
>
> Now, just have to find time to use all of this :-)
>
I just should say that I am not succeed to provide really safe ghosts.
If you will try to implement new kind of proxy (on top of Ghost) it is
possible to hang image.
Problem that when you make some mistake in implementation it usually lead
to infinite recursion and interrupt usually not helps because opened
debugger produces new messages to ghost which produces another recursion
due to original errors. And errors are not only exceptions but some
unexpected messages to proxies. For example if you will use Set to
implement proxy behaviour (for some reason) it will send #= and #hash to
proxy when you will try to add it.
There are tools now to minimize such cases. For example standart meta level
will not intercept messages from debugger. But as soon as you start
experiment with empty meta level you will get such problems.
This week Guille Polito start to use Ghost for new proxies and he was not
happy due to this kind of problems. Maybe together we will find some
solution how to make ghosts safe.
March 24, 2016
Re: [Pharo-dev] [Ann] New version of Ghost
by stepharo
Le 24/3/16 17:48, Denis Kudriashov a écrit :
> Hello.
>
> I finished new version of Ghost:
>
> * DNU approach for basic proxies instead of #cannotInterpret: trick
> (trick used only for class proxies)
> * Abstract proxy classes uses Ghost name instead of Proxy: there are
> GHObjectGhost and GHClassGhost.
> * GHProxyHandler renamed to GHGhostBehaviour. Concrete ghosts should
> implement #ghostBehaviour instead of #proxyHandler.
> * GHGhostBehaviour should define #currentMetaLevel to specify set of
> messages which should not be intercepted. Such meta messages will
> be executed under ghost instance by subclass of GHMetaMessages.
>
> In previous version there was dictionary which maps meta message
> selector to implementation selector. It was not suitable. Now meta
> messages should be directly implemented on particular
> GHMetaMessages subclass and all it methods are considered meta.
>
> So GhostBehaviour should return instance of GHMetaLevel with meta
> messages implementation class:
>
Do you mean that you use subclasses to register selectors that will not
be trapped?
Why is is better than a collection on the object?
>
> o GHMetaLevel with: GHEmptyMetaMessages "when all possible
> messages should intercepted"
> o GHMetaLevel with: GHStandartMetaMessages "when tools specific
> messages should not be intercepted"
>
> For example standard meta messages implements #inspect:
>
Pay attention Standard and no Standart
>
> GHStandartMetaMessages>>inspect
>
> "Create and schedule an Inspector in which the user can
> examine the receiver's variables."
>
> ^ Smalltalk tools inspector inspect: *ghost*
>
>
> * Traits for methods explicitly defined on ghosts: TMinimalProxy,
> TNotNilProxy, TIdentifiedProxy (with #=, #hash, #class). Concrete
> proxies can add this traits to itself independently from meta
> level. For example traits supply convenient methods to retrieve
> ghost information in polymorphic way with objects:
> o ghost isGhost
> o ghost ghostClass "returns actual class of receiver"
>
when I read ghostClass I expect getting the class
implementing the proxy not the proxied class.
So I'm confused.
> o ghost ghostPrintString "returns string which represents ghost
> from meta level point of view"
>
> This traits are suitable and they provide some kind of
> optimisation for proxies (methods from traits are executed
> directly instead of complex meta messages mechanizm). But maybe
> they are superfluous. For example they can't be reused for class
> proxies which substitute real object classes (to intercept all
> instance messages).
>
> * GHClassGhost able to replace class of real objects. It implements
> cannotInterpret: trick to intercept all instance messages.
> Subclasses should define two behaviours: #ghostBehaviour (as any
> other ghost) and #instancesBehaviour which will process instance
> messages. In previous version it was different message to same
> #ghostBehaviour.
> * New kind of proxies:
> o GHObjectVirus. It is special kind of GHClassProxy. It infects
> real object to intercept it messages. From meta level infected
> object looks like healthy object which means that meta
> messages are executed by infected object itself. As class
> virus looks like real victim class. So in case when virus is
> created with standard meta level tools will not differ him
> from health object. There are special messages which allow ask
> object about viruses:
> + infectedObject isInfectedByVirus
> + infectedObject virus
> + infectedObject recoverFromVirus
>
I could not understand what is a Virus.
> o GHLearningObject. It is suitable proxy which retrieves all
> unknown methods from teacher class. Thank's Stephan for this idea.
>
> This kind of proxy allows me easily find required set of
> messages to support inspectors and debuggers. You can create
> instance of learning object by:
>
> GHLearningObject withTeacher: Object.
>
> And any operation with it will fill studiedMessages
> dictionary. In my case I opened GTInspector on it and got all
> messages which was needed for him.
>
:)
>
> * Ghosts works correctly with latest Pharo 5 tools (basic inspector,
> GTInspector, SpecDebugger, GTDebugger). Required methods for tools
> are extracted to 'Ghost-GTSupport' package.
> * Repackaging:
> o Ghost-ObjectProxies. It contains all core classes and abstract
> GHObjectGhost which is based on DNU
> o Ghost-ClassProxies. It contains code for proxy which can
> substitute class of real object. GHClassGhost implements
> cannotInterpret: trick to intercept all instance messages. And
> it implement support for debugging such methods.
> o Ghost-LearningObject
> o Ghost-ObjectVirus
> o Ghost-GTSupport
> o test packages
> * All code moved to Pharo repository
> http://smalltalkhub.com/#!/~Pharo/Ghost
> <http://smalltalkhub.com/#%21/%7EPharo/Ghost> (in includes
> packages from CAR repo too)
>
>
Denis it would be good to have some examples described.
> You can load new version by:
>
> Gofer it
> smalltalkhubUser: 'Pharo' project: 'Ghost';
> configurationOf: 'Ghost';
> loadStable
>
>
> I use it now in Seamless and Mocketry.
>
>
March 24, 2016
Re: [Pharo-dev] [Ann] New version of Ghost
by stepharo
Le 24/3/16 17:48, Denis Kudriashov a écrit :
> Hello.
>
> I finished new version of Ghost:
>
> * DNU approach for basic proxies instead of #cannotInterpret: trick
> (trick used only for class proxies)
>
Does it mean that we cannot proxy classes?
> * Abstract proxy classes uses Ghost name instead of Proxy: there are
> GHObjectGhost and GHClassGhost.
> * GHProxyHandler renamed to GHGhostBehaviour. Concrete ghosts should
> implement #ghostBehaviour instead of #proxyHandler.
> * GHGhostBehaviour should define #currentMetaLevel to specify set of
> messages which should not be intercepted. Such meta messages will
> be executed under ghost instance by subclass of GHMetaMessages.
>
> In previous version there was dictionary which maps meta message
> selector to implementation selector. It was not suitable. Now meta
> messages should be directly implemented on particular
> GHMetaMessages subclass and all it methods are considered meta.
>
> So GhostBehaviour should return instance of GHMetaLevel with meta
> messages implementation class:
>
> o GHMetaLevel with: GHEmptyMetaMessages "when all possible
> messages should intercepted"
> o GHMetaLevel with: GHStandartMetaMessages "when tools specific
> messages should not be intercepted"
>
> For example standard meta messages implements #inspect:
>
> GHStandartMetaMessages>>inspect
>
> "Create and schedule an Inspector in which the user can
> examine the receiver's variables."
>
> ^ Smalltalk tools inspector inspect: *ghost*
>
>
> * Traits for methods explicitly defined on ghosts: TMinimalProxy,
> TNotNilProxy, TIdentifiedProxy (with #=, #hash, #class). Concrete
> proxies can add this traits to itself independently from meta
> level. For example traits supply convenient methods to retrieve
> ghost information in polymorphic way with objects:
> o ghost isGhost
> o ghost ghostClass "returns actual class of receiver"
> o ghost ghostPrintString "returns string which represents ghost
> from meta level point of view"
>
> This traits are suitable and they provide some kind of
> optimisation for proxies (methods from traits are executed
> directly instead of complex meta messages mechanizm). But maybe
> they are superfluous. For example they can't be reused for class
> proxies which substitute real object classes (to intercept all
> instance messages).
>
> * GHClassGhost able to replace class of real objects. It implements
> cannotInterpret: trick to intercept all instance messages.
> Subclasses should define two behaviours: #ghostBehaviour (as any
> other ghost) and #instancesBehaviour which will process instance
> messages. In previous version it was different message to same
> #ghostBehaviour.
> * New kind of proxies:
> o GHObjectVirus. It is special kind of GHClassProxy. It infects
> real object to intercept it messages. From meta level infected
> object looks like healthy object which means that meta
> messages are executed by infected object itself. As class
> virus looks like real victim class. So in case when virus is
> created with standard meta level tools will not differ him
> from health object. There are special messages which allow ask
> object about viruses:
> + infectedObject isInfectedByVirus
> + infectedObject virus
> + infectedObject recoverFromVirus
>
> o GHLearningObject. It is suitable proxy which retrieves all
> unknown methods from teacher class. Thank's Stephan for this idea.
>
> This kind of proxy allows me easily find required set of
> messages to support inspectors and debuggers. You can create
> instance of learning object by:
>
> GHLearningObject withTeacher: Object.
>
> And any operation with it will fill studiedMessages
> dictionary. In my case I opened GTInspector on it and got all
> messages which was needed for him.
>
> * Ghosts works correctly with latest Pharo 5 tools (basic inspector,
> GTInspector, SpecDebugger, GTDebugger). Required methods for tools
> are extracted to 'Ghost-GTSupport' package.
> * Repackaging:
> o Ghost-ObjectProxies. It contains all core classes and abstract
> GHObjectGhost which is based on DNU
> o Ghost-ClassProxies. It contains code for proxy which can
> substitute class of real object. GHClassGhost implements
> cannotInterpret: trick to intercept all instance messages. And
> it implement support for debugging such methods.
> o Ghost-LearningObject
> o Ghost-ObjectVirus
> o Ghost-GTSupport
> o test packages
> * All code moved to Pharo repository
> http://smalltalkhub.com/#!/~Pharo/Ghost
> <http://smalltalkhub.com/#%21/%7EPharo/Ghost> (in includes
> packages from CAR repo too)
>
>
> You can load new version by:
>
> Gofer it
> smalltalkhubUser: 'Pharo' project: 'Ghost';
> configurationOf: 'Ghost';
> loadStable
>
>
> I use it now in Seamless and Mocketry.
>
>
March 24, 2016
Re: [Pharo-dev] [Ann] New version of Ghost
by Denis Kudriashov
Hi.
Thank's for kind words.
2016-03-24 19:22 GMT+01:00 Mariano Martinez Peck <marianopeck(a)gmail.com>:
>
>> - GHClassGhost able to replace class of real objects. It implements
>> cannotInterpret: trick to intercept all instance messages. Subclasses
>> should define two behaviours: #ghostBehaviour (as any other ghost) and
>> #instancesBehaviour which will process instance messages. In previous
>> version it was different message to same #ghostBehaviour.
>>
>>
In your original version you implemented #cannotInterpert: for instance
messages such way:
proxy proxyHandler *handleInterceptionToInstance:* interception.
And proxy handler was responsible for two messages:
#handleInterceptionToInstance:
and #handleInterception:.
In my version I ask proxy for different kind of handler (ghostBehaviour):
GHObjectGhost>>doesNotUnderstand: aMessage
self *ghostBehaviour* intercept: aMessage to: self
GHInstanceMessagesInterceptor>>cannotInterpret: aMessage
"some logic to find ghostClass"
ghostClass *instancesBehaviour* intercept: aMessage to: self
>
>> - New kind of proxies:
>> - GHObjectVirus. It is special kind of GHClassProxy. It infects real
>> object to intercept it messages. From meta level infected object looks like
>> healthy object which means that meta messages are executed by infected
>> object itself. As class virus looks like real victim class. So in case when
>> virus is created with standard meta level tools will not differ him from
>> health object. There are special messages which allow ask object about
>> viruses:
>> - infectedObject isInfectedByVirus
>> - infectedObject virus
>> - infectedObject recoverFromVirus
>>
>>
> Sorry I did not get this one.
>
Good example where I use viruses is stubbing real objects in Mocketry. I
will announce it soon. You can do this:
rect := 0@0 corner: 2@3
rect stub area willReturn: 1000.
rect area "=> 1000".
rect origin "=> 0@0".
>From any tool you will see normal rectangle. Nothing special. But in
reality it is infected by virus which delegate all messages to "Mocketry
machinery". And you can detect it by:
rect isInfectedByVirus "=> true"
And you can heal infected object:
rect recoverFromVirus. "or virus heal: infectedObject"
rect isInfectedByVirus "=> false"
March 24, 2016
Re: [Pharo-dev] [Ann] New version of Ghost
by Mariano Martinez Peck
On Thu, Mar 24, 2016 at 1:48 PM, Denis Kudriashov <dionisiydk(a)gmail.com>
wrote:
> Hello.
>
> I finished new version of Ghost:
>
That's very nice to hear!! I love to see someone took it and improve it :)
>
> - DNU approach for basic proxies instead of #cannotInterpret: trick
> (trick used only for class proxies)
>
> Excellent. Yes, I remember the discussion we had weeks ago.
>
> -
> - Abstract proxy classes uses Ghost name instead of Proxy: there are
> GHObjectGhost and GHClassGhost.
> - GHProxyHandler renamed to GHGhostBehaviour. Concrete ghosts should
> implement #ghostBehaviour instead of #proxyHandler.
> - GHGhostBehaviour should define #currentMetaLevel to specify set of
> messages which should not be intercepted. Such meta messages will be
> executed under ghost instance by subclass of GHMetaMessages.
>
> In previous version there was dictionary which maps meta message selector
> to implementation selector. It was not suitable. Now meta messages should
> be directly implemented on particular GHMetaMessages subclass and all it
> methods are considered meta.
>
> So GhostBehaviour should return instance of GHMetaLevel with meta messages
> implementation class:
>
>
> - GHMetaLevel with: GHEmptyMetaMessages "when all possible messages
> should intercepted"
> - GHMetaLevel with: GHStandartMetaMessages "when tools specific
> messages should not be intercepted"
>
> For example standard meta messages implements #inspect:
>
> GHStandartMetaMessages>>inspect
>
> "Create and schedule an Inspector in which the user can examine the
> receiver's variables."
>
> ^ Smalltalk tools inspector inspect: *ghost*
>
>
>
Nice. Yes, this is much better than my original dictionary-based solution
>
> - Traits for methods explicitly defined on ghosts: TMinimalProxy,
> TNotNilProxy, TIdentifiedProxy (with #=, #hash, #class). Concrete proxies
> can add this traits to itself independently from meta level. For example
> traits supply convenient methods to retrieve ghost information in
> polymorphic way with objects:
> - ghost isGhost
> - ghost ghostClass "returns actual class of receiver"
> - ghost ghostPrintString "returns string which represents ghost
> from meta level point of view"
>
> This traits are suitable and they provide some kind of optimisation for
> proxies (methods from traits are executed directly instead of complex meta
> messages mechanizm). But maybe they are superfluous. For example they can't
> be reused for class proxies which substitute real object classes (to
> intercept all instance messages).
>
>
Good idea as well. Just as yet another useful example of this, I recommend
watching the proxies I defined for Marea as you will have interesting
proxies for classes and metaclasses. Basically, I defined quite some
methods in those proxies so that to avoid intercepting and faulting my
objects. See Marea code and watch for it's proxies! Let me know if you
found the methods I am talking about.
>
> - GHClassGhost able to replace class of real objects. It implements
> cannotInterpret: trick to intercept all instance messages. Subclasses
> should define two behaviours: #ghostBehaviour (as any other ghost) and
> #instancesBehaviour which will process instance messages. In previous
> version it was different message to same #ghostBehaviour.
> - New kind of proxies:
> - GHObjectVirus. It is special kind of GHClassProxy. It infects real
> object to intercept it messages. From meta level infected object looks like
> healthy object which means that meta messages are executed by infected
> object itself. As class virus looks like real victim class. So in case when
> virus is created with standard meta level tools will not differ him from
> health object. There are special messages which allow ask object about
> viruses:
> - infectedObject isInfectedByVirus
> - infectedObject virus
> - infectedObject recoverFromVirus
>
>
Sorry I did not get this one.
>
> - GHLearningObject. It is suitable proxy which retrieves all unknown
> methods from teacher class. Thank's Stephan for this idea.
>
> This kind of proxy allows me easily find required set of messages to
> support inspectors and debuggers. You can create instance of learning
> object by:
>
> GHLearningObject withTeacher: Object.
>
> And any operation with it will fill studiedMessages dictionary. In my case
> I opened GTInspector on it and got all messages which was needed for him.
>
>
Great idea too. I had to come with the set of mapped selectors (the
dictionary) by poor man human try and error hahaha.
>
> - Ghosts works correctly with latest Pharo 5 tools (basic inspector,
> GTInspector, SpecDebugger, GTDebugger). Required methods for tools are
> extracted to 'Ghost-GTSupport' package.
> - Repackaging:
> - Ghost-ObjectProxies. It contains all core classes and abstract
> GHObjectGhost which is based on DNU
> - Ghost-ClassProxies. It contains code for proxy which can
> substitute class of real object. GHClassGhost implements cannotInterpret:
> trick to intercept all instance messages. And it implement support for
> debugging such methods.
> - Ghost-LearningObject
> - Ghost-ObjectVirus
> - Ghost-GTSupport
> - test packages
> - All code moved to Pharo repository
> http://smalltalkhub.com/#!/~Pharo/Ghost (in includes packages from CAR
> repo too)
>
>
>
Excellent.
Thanks Denis for pushing Ghost further!
--
Mariano
http://marianopeck.wordpress.com
March 24, 2016
Re: [Pharo-dev] [Ann] New version of Ghost
by phil@highoctane.be
Awesome. Things are looking good.
Now, just have to find time to use all of this :-)
Phil
On Thu, Mar 24, 2016 at 5:48 PM, Denis Kudriashov <dionisiydk(a)gmail.com>
wrote:
> Hello.
>
> I finished new version of Ghost:
>
> - DNU approach for basic proxies instead of #cannotInterpret: trick
> (trick used only for class proxies)
> - Abstract proxy classes uses Ghost name instead of Proxy: there are
> GHObjectGhost and GHClassGhost.
> - GHProxyHandler renamed to GHGhostBehaviour. Concrete ghosts should
> implement #ghostBehaviour instead of #proxyHandler.
> - GHGhostBehaviour should define #currentMetaLevel to specify set of
> messages which should not be intercepted. Such meta messages will be
> executed under ghost instance by subclass of GHMetaMessages.
>
> In previous version there was dictionary which maps meta message selector
> to implementation selector. It was not suitable. Now meta messages should
> be directly implemented on particular GHMetaMessages subclass and all it
> methods are considered meta.
>
> So GhostBehaviour should return instance of GHMetaLevel with meta messages
> implementation class:
>
>
> - GHMetaLevel with: GHEmptyMetaMessages "when all possible messages
> should intercepted"
> - GHMetaLevel with: GHStandartMetaMessages "when tools specific
> messages should not be intercepted"
>
> For example standard meta messages implements #inspect:
>
> GHStandartMetaMessages>>inspect
>
> "Create and schedule an Inspector in which the user can examine the
> receiver's variables."
>
> ^ Smalltalk tools inspector inspect: *ghost*
>
>
>
> - Traits for methods explicitly defined on ghosts: TMinimalProxy,
> TNotNilProxy, TIdentifiedProxy (with #=, #hash, #class). Concrete proxies
> can add this traits to itself independently from meta level. For example
> traits supply convenient methods to retrieve ghost information in
> polymorphic way with objects:
> - ghost isGhost
> - ghost ghostClass "returns actual class of receiver"
> - ghost ghostPrintString "returns string which represents ghost
> from meta level point of view"
>
> This traits are suitable and they provide some kind of optimisation for
> proxies (methods from traits are executed directly instead of complex meta
> messages mechanizm). But maybe they are superfluous. For example they can't
> be reused for class proxies which substitute real object classes (to
> intercept all instance messages).
>
>
> - GHClassGhost able to replace class of real objects. It implements
> cannotInterpret: trick to intercept all instance messages. Subclasses
> should define two behaviours: #ghostBehaviour (as any other ghost) and
> #instancesBehaviour which will process instance messages. In previous
> version it was different message to same #ghostBehaviour.
> - New kind of proxies:
> - GHObjectVirus. It is special kind of GHClassProxy. It infects real
> object to intercept it messages. From meta level infected object looks like
> healthy object which means that meta messages are executed by infected
> object itself. As class virus looks like real victim class. So in case when
> virus is created with standard meta level tools will not differ him from
> health object. There are special messages which allow ask object about
> viruses:
> - infectedObject isInfectedByVirus
> - infectedObject virus
> - infectedObject recoverFromVirus
>
>
> - GHLearningObject. It is suitable proxy which retrieves all unknown
> methods from teacher class. Thank's Stephan for this idea.
>
> This kind of proxy allows me easily find required set of messages to
> support inspectors and debuggers. You can create instance of learning
> object by:
>
> GHLearningObject withTeacher: Object.
>
> And any operation with it will fill studiedMessages dictionary. In my case
> I opened GTInspector on it and got all messages which was needed for him.
>
>
> - Ghosts works correctly with latest Pharo 5 tools (basic inspector,
> GTInspector, SpecDebugger, GTDebugger). Required methods for tools are
> extracted to 'Ghost-GTSupport' package.
> - Repackaging:
> - Ghost-ObjectProxies. It contains all core classes and abstract
> GHObjectGhost which is based on DNU
> - Ghost-ClassProxies. It contains code for proxy which can
> substitute class of real object. GHClassGhost implements cannotInterpret:
> trick to intercept all instance messages. And it implement support for
> debugging such methods.
> - Ghost-LearningObject
> - Ghost-ObjectVirus
> - Ghost-GTSupport
> - test packages
> - All code moved to Pharo repository
> http://smalltalkhub.com/#!/~Pharo/Ghost (in includes packages from CAR
> repo too)
>
>
> You can load new version by:
>
> Gofer it
> smalltalkhubUser: 'Pharo' project: 'Ghost';
> configurationOf: 'Ghost';
> loadStable
>
>
> I use it now in Seamless and Mocketry.
>
>
>
March 24, 2016
[Ann] New version of Ghost
by Denis Kudriashov
Hello.
I finished new version of Ghost:
- DNU approach for basic proxies instead of #cannotInterpret: trick
(trick used only for class proxies)
- Abstract proxy classes uses Ghost name instead of Proxy: there are
GHObjectGhost and GHClassGhost.
- GHProxyHandler renamed to GHGhostBehaviour. Concrete ghosts should
implement #ghostBehaviour instead of #proxyHandler.
- GHGhostBehaviour should define #currentMetaLevel to specify set of
messages which should not be intercepted. Such meta messages will be
executed under ghost instance by subclass of GHMetaMessages.
In previous version there was dictionary which maps meta message selector
to implementation selector. It was not suitable. Now meta messages should
be directly implemented on particular GHMetaMessages subclass and all it
methods are considered meta.
So GhostBehaviour should return instance of GHMetaLevel with meta messages
implementation class:
- GHMetaLevel with: GHEmptyMetaMessages "when all possible messages
should intercepted"
- GHMetaLevel with: GHStandartMetaMessages "when tools specific
messages should not be intercepted"
For example standard meta messages implements #inspect:
GHStandartMetaMessages>>inspect
"Create and schedule an Inspector in which the user can examine the
receiver's variables."
^ Smalltalk tools inspector inspect: *ghost*
- Traits for methods explicitly defined on ghosts: TMinimalProxy,
TNotNilProxy, TIdentifiedProxy (with #=, #hash, #class). Concrete proxies
can add this traits to itself independently from meta level. For example
traits supply convenient methods to retrieve ghost information in
polymorphic way with objects:
- ghost isGhost
- ghost ghostClass "returns actual class of receiver"
- ghost ghostPrintString "returns string which represents ghost from
meta level point of view"
This traits are suitable and they provide some kind of optimisation for
proxies (methods from traits are executed directly instead of complex meta
messages mechanizm). But maybe they are superfluous. For example they can't
be reused for class proxies which substitute real object classes (to
intercept all instance messages).
- GHClassGhost able to replace class of real objects. It implements
cannotInterpret: trick to intercept all instance messages. Subclasses
should define two behaviours: #ghostBehaviour (as any other ghost) and
#instancesBehaviour which will process instance messages. In previous
version it was different message to same #ghostBehaviour.
- New kind of proxies:
- GHObjectVirus. It is special kind of GHClassProxy. It infects real
object to intercept it messages. From meta level infected object
looks like
healthy object which means that meta messages are executed by infected
object itself. As class virus looks like real victim class. So
in case when
virus is created with standard meta level tools will not differ him from
health object. There are special messages which allow ask object about
viruses:
- infectedObject isInfectedByVirus
- infectedObject virus
- infectedObject recoverFromVirus
- GHLearningObject. It is suitable proxy which retrieves all unknown
methods from teacher class. Thank's Stephan for this idea.
This kind of proxy allows me easily find required set of messages to
support inspectors and debuggers. You can create instance of learning
object by:
GHLearningObject withTeacher: Object.
And any operation with it will fill studiedMessages dictionary. In my case
I opened GTInspector on it and got all messages which was needed for him.
- Ghosts works correctly with latest Pharo 5 tools (basic inspector,
GTInspector, SpecDebugger, GTDebugger). Required methods for tools are
extracted to 'Ghost-GTSupport' package.
- Repackaging:
- Ghost-ObjectProxies. It contains all core classes and abstract
GHObjectGhost which is based on DNU
- Ghost-ClassProxies. It contains code for proxy which can substitute
class of real object. GHClassGhost implements cannotInterpret: trick to
intercept all instance messages. And it implement support for debugging
such methods.
- Ghost-LearningObject
- Ghost-ObjectVirus
- Ghost-GTSupport
- test packages
- All code moved to Pharo repository
http://smalltalkhub.com/#!/~Pharo/Ghost (in includes packages from CAR
repo too)
You can load new version by:
Gofer it
smalltalkhubUser: 'Pharo' project: 'Ghost';
configurationOf: 'Ghost';
loadStable
I use it now in Seamless and Mocketry.
March 24, 2016
Re: [Pharo-dev] [squeak-dev] [Vm-dev] I would be extremely grateful for a reproducible case for the following Socket issue
by Holger Freyther
> On 24 Mar 2016, at 10:16, Levente Uzonyi <leves(a)caesar.elte.hu> wrote:
>
> Hi Eliot,
>
> The snippet below, evaluated from a workspace, triggered the issue in less than a minute for me, three times in a row.
> Both processes will halt if #sloppyWaitForDataIfClosed: doesn't return within a second. If you send #dataAvailable to the socket, you'll find that it has data ready to be read, but its readSemaphore has no signal.
does it happen if you have strace -o output.txt -f on the VM as well?
kind regards
holger
March 24, 2016
[pharo-project/pharo-core] ae8079: 50660
by GitHub
Branch: refs/heads/5.0
Home: https://github.com/pharo-project/pharo-core
Commit: ae807900241caad109189f1389e19b9403cf4311
https://github.com/pharo-project/pharo-core/commit/ae807900241caad109189f13…
Author: Jenkins Build Server <board(a)pharo-project.org>
Date: 2016-03-24 (Thu, 24 Mar 2016)
Changed paths:
M ConfigurationOfUnifiedFFI.package/ConfigurationOfUnifiedFFI.class/instance/symbolic versions/stable_.st
A ConfigurationOfUnifiedFFI.package/ConfigurationOfUnifiedFFI.class/instance/versions/v0%5F18_.st
R ScriptLoader50.package/ScriptLoader.class/instance/pharo - scripts/script50659.st
A ScriptLoader50.package/ScriptLoader.class/instance/pharo - scripts/script50660.st
R ScriptLoader50.package/ScriptLoader.class/instance/pharo - updates/update50659.st
A ScriptLoader50.package/ScriptLoader.class/instance/pharo - updates/update50660.st
M ScriptLoader50.package/ScriptLoader.class/instance/public/commentForCurrentUpdate.st
M UnifiedFFI.package/FFICallout.class/README.md
R UnifiedFFI.package/FFICalloutMethodBuilder.class/instance/accessing/createFFICallout.st
A UnifiedFFI.package/FFICalloutMethodBuilder.class/instance/private factory/createFFICallout.st
A UnifiedFFI.package/FFICalloutMethodBuilder.class/instance/private factory/createFFICalloutLiteralFromSpec_.st
R UnifiedFFI.package/FFICalloutMethodBuilder.class/instance/private/createFFICalloutLiteralFromSpec_.st
A UnifiedFFI.package/FFICalloutMethodBuilder.class/instance/private/isIndirectCall.st
A UnifiedFFI.package/FFICalloutMethodBuilder.class/instance/private/makeIndirectCall_.st
M UnifiedFFI.package/FFIMethodRegistry.class/class/system startup/startUp_.st
M UnifiedFFI.package/FFIMethodRegistry.class/definition.st
R UnifiedFFI.package/FFIMethodRegistry.class/instance/accessing/checkPlatform.st
R UnifiedFFI.package/FFIMethodRegistry.class/instance/accessing/lastActivePlatform.st
M UnifiedFFI.package/FFIMethodRegistry.class/instance/initialization/initialize.st
Log Message:
-----------
50660
17869 add support for indirect calls
https://pharo.fogbugz.com/f/cases/17869
http://files.pharo.org/image/50/50660.zip
March 24, 2016
[pharo-project/pharo-core]
by GitHub
Branch: refs/tags/50660
Home: https://github.com/pharo-project/pharo-core
March 24, 2016