How can I do memoization in Pharo? I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages. I have expensive calls that do not have to refresh their results as often as they are called. TIA Phil
What's wrong with? myData ^ data ifNil: [data := self computeMe] Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code. Aspects would solve this but we do not have that. Also I need the mechanism to be removable. So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly? Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
Ghost won't be a big help here. Slots would be a good solution but not if it needs to be removable on runtime. So it seems MethodWrappers is your best bet. I'd try create a caching MethodWrapper, mark all the needed methods with a pragma and then install the MethodWrapper on these. Could be a package wide install/uninstall if you need that. Norbert
Am 04.11.2014 um 07:03 schrieb "phil@highoctane.be" <phil@highoctane.be>:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
On Tue, Nov 4, 2014 at 9:59 AM, Norbert Hartl <norbert@hartl.name> wrote:
Ghost won't be a big help here. Slots would be a good solution but not if it needs to be removable on runtime. So it seems MethodWrappers is your best bet. I'd try create a caching MethodWrapper, mark all the needed methods with a pragma and then install the MethodWrapper on these. Could be a package wide install/uninstall if you need that.
I loaded MethodWrappers in 3.0 as I saw in http://forum.world.st/MethodWrappers-td3829576.html#a4601624 Gofer it squeaksource: 'MethodWrappers'; package: 'MethodWrappers4'; load. It loads. But no test seems to be fine. [image: Inline image 1] What version should I be using? Phil
Norbert
Am 04.11.2014 um 07:03 schrieb "phil@highoctane.be" <phil@highoctane.be>:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
I'm not sure. I thought Spy would use them but it does not load in a fresh pharo3 for me. Did you try http://www.squeaksource.com/ObjectsAsMethodsWrap/ <http://www.squeaksource.com/ObjectsAsMethodsWrap/> ? Norbert
Am 04.11.2014 um 11:53 schrieb phil@highoctane.be:
On Tue, Nov 4, 2014 at 9:59 AM, Norbert Hartl <norbert@hartl.name <mailto:norbert@hartl.name>> wrote: Ghost won't be a big help here. Slots would be a good solution but not if it needs to be removable on runtime. So it seems MethodWrappers is your best bet. I'd try create a caching MethodWrapper, mark all the needed methods with a pragma and then install the MethodWrapper on these. Could be a package wide install/uninstall if you need that.
I loaded MethodWrappers in 3.0 as I saw in http://forum.world.st/MethodWrappers-td3829576.html#a4601624 <http://forum.world.st/MethodWrappers-td3829576.html#a4601624>
Gofer it squeaksource: 'MethodWrappers'; package: 'MethodWrappers4'; load.
It loads.
But no test seems to be fine.
<image.png>
What version should I be using?
Phil
Norbert
Am 04.11.2014 um 07:03 schrieb "phil@highoctane.be <mailto:phil@highoctane.be>" <phil@highoctane.be <mailto:phil@highoctane.be>>:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu <mailto:hilaire@drgeo.eu>> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be <mailto:phil@highoctane.be> a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu <http://drgeo.eu/> iStoa - http://istoa.drgeo.eu <http://istoa.drgeo.eu/>
On Tue, Nov 4, 2014 at 12:06 PM, Norbert Hartl <norbert@hartl.name> wrote:
I'm not sure. I thought Spy would use them but it does not load in a fresh pharo3 for me. Did you try
This one loads and tests are green once the "_"s are replaced with ":="s Thx for the pointer. I'll see how I can hook a TTLCache into this. Phil
?
Norbert
Am 04.11.2014 um 11:53 schrieb phil@highoctane.be:
On Tue, Nov 4, 2014 at 9:59 AM, Norbert Hartl <norbert@hartl.name> wrote:
Ghost won't be a big help here. Slots would be a good solution but not if it needs to be removable on runtime. So it seems MethodWrappers is your best bet. I'd try create a caching MethodWrapper, mark all the needed methods with a pragma and then install the MethodWrapper on these. Could be a package wide install/uninstall if you need that.
I loaded MethodWrappers in 3.0 as I saw in http://forum.world.st/MethodWrappers-td3829576.html#a4601624
Gofer it squeaksource: 'MethodWrappers'; package: 'MethodWrappers4'; load.
It loads.
But no test seems to be fine.
<image.png>
What version should I be using?
Phil
Norbert
Am 04.11.2014 um 07:03 schrieb "phil@highoctane.be" <phil@highoctane.be>:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
Am 04.11.2014 um 12:47 schrieb phil@highoctane.be:
On Tue, Nov 4, 2014 at 12:06 PM, Norbert Hartl <norbert@hartl.name <mailto:norbert@hartl.name>> wrote: I'm not sure. I thought Spy would use them but it does not load in a fresh pharo3 for me. Did you try
http://www.squeaksource.com/ObjectsAsMethodsWrap/ <http://www.squeaksource.com/ObjectsAsMethodsWrap/>
This one loads and tests are green once the "_"s are replaced with ":="s
Thx for the pointer. I'll see how I can hook a TTLCache into this.
I don't know your exact use case. But if you need one cache for your package with TTLCache then this could be done in one pass. You can have an installer that scans your package for methods containing a special pragma. Then you exchange every compiled method (installing the wrapper) with the wrapper that accesses its value from the same TTLCache having the compiled method as key. So you would have exchanged a lot of methods that share a single cache. As the TTLCache gives the hit rate on printString you get back an effectivity number for free. Norbert
Phil
?
Norbert
Am 04.11.2014 um 11:53 schrieb phil@highoctane.be <mailto:phil@highoctane.be>:
On Tue, Nov 4, 2014 at 9:59 AM, Norbert Hartl <norbert@hartl.name <mailto:norbert@hartl.name>> wrote: Ghost won't be a big help here. Slots would be a good solution but not if it needs to be removable on runtime. So it seems MethodWrappers is your best bet. I'd try create a caching MethodWrapper, mark all the needed methods with a pragma and then install the MethodWrapper on these. Could be a package wide install/uninstall if you need that.
I loaded MethodWrappers in 3.0 as I saw in http://forum.world.st/MethodWrappers-td3829576.html#a4601624 <http://forum.world.st/MethodWrappers-td3829576.html#a4601624>
Gofer it squeaksource: 'MethodWrappers'; package: 'MethodWrappers4'; load.
It loads.
But no test seems to be fine.
<image.png>
What version should I be using?
Phil
Norbert
Am 04.11.2014 um 07:03 schrieb "phil@highoctane.be <mailto:phil@highoctane.be>" <phil@highoctane.be <mailto:phil@highoctane.be>>:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu <mailto:hilaire@drgeo.eu>> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be <mailto:phil@highoctane.be> a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu <http://drgeo.eu/> iStoa - http://istoa.drgeo.eu <http://istoa.drgeo.eu/>
On 04 Nov 2014, at 09:59, Norbert Hartl <norbert@hartl.name> wrote:
Ghost won't be a big help here. Slots would be a good solution but not if it needs to be removable on runtime. So it seems MethodWrappers is your best bet. I'd try create a caching MethodWrapper, mark all the needed methods with a pragma and then install the MethodWrapper on these. Could be a package wide install/uninstall if you need that.
This would be a nice useless for Reflectivity⦠one way of describing it is âlike method wrappers, but generalizedâ. e.g. you can put a âwrapperâ on any kind of AST node. After the breakpoints, we could use that as the next client. Marcus
Norbert
Am 04.11.2014 um 07:03 schrieb "phil@highoctane.be <mailto:phil@highoctane.be>" <phil@highoctane.be <mailto:phil@highoctane.be>>:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu <mailto:hilaire@drgeo.eu>> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be <mailto:phil@highoctane.be> a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu <http://drgeo.eu/> iStoa - http://istoa.drgeo.eu <http://istoa.drgeo.eu/>
Am 04.11.2014 um 13:16 schrieb Marcus Denker <marcus.denker@inria.fr>:
On 04 Nov 2014, at 09:59, Norbert Hartl <norbert@hartl.name <mailto:norbert@hartl.name>> wrote:
Ghost won't be a big help here. Slots would be a good solution but not if it needs to be removable on runtime. So it seems MethodWrappers is your best bet. I'd try create a caching MethodWrapper, mark all the needed methods with a pragma and then install the MethodWrapper on these. Could be a package wide install/uninstall if you need that.
This would be a nice useless for Reflectivity⦠one way of describing it is âlike method wrappers, but generalizedâ. e.g. you can put a âwrapperâ on any kind of AST node. After the breakpoints, we could use that as the next client.
Sure, I forgot. If I would have the need to implement it I would try solving it with meta-links. Basically it does the same as the method wrapper without having the need to exchange the compiled method. Norbert
Marcus
Norbert
Am 04.11.2014 um 07:03 schrieb "phil@highoctane.be <mailto:phil@highoctane.be>" <phil@highoctane.be <mailto:phil@highoctane.be>>:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu <mailto:hilaire@drgeo.eu>> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be <mailto:phil@highoctane.be> a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu <http://drgeo.eu/> iStoa - http://istoa.drgeo.eu <http://istoa.drgeo.eu/>
2014-11-04 13:16 GMT+01:00 Marcus Denker <marcus.denker@inria.fr>:
On 04 Nov 2014, at 09:59, Norbert Hartl <norbert@hartl.name> wrote:
Ghost won't be a big help here. Slots would be a good solution but not if it needs to be removable on runtime. So it seems MethodWrappers is your best bet. I'd try create a caching MethodWrapper, mark all the needed methods with a pragma and then install the MethodWrapper on these. Could be a package wide install/uninstall if you need that.
This would be a nice useless for Reflectivity⦠one way of describing it is âlike method wrappers, but generalizedâ. e.g. you can put a âwrapperâ on any kind of AST node. After the breakpoints, we could use that as the next client.
yes Nick's Reflectogram would also be usable for that but it would require a special VM currently. Indeed, it would be better to have at the compiler level. Then, Ghost is also usable for that since Mariano did a MethodWrapper like implementation using Ghost in 5 lines or so. And Ghost should load in Pharo 3 ;-) Luc
Marcus
Norbert
Am 04.11.2014 um 07:03 schrieb "phil@highoctane.be" <phil@highoctane.be>:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
Hi There is AspectS package at old squeaksource site. I not know is it working in Pharo. And there was presentation at Esug few years ago about another implementation of aspects in Pharo ( i not remember project name) 04 ноÑб. 2014 г. 9:04 полÑзоваÑÐµÐ»Ñ "phil@highoctane.be" <phil@highoctane.be> напиÑал:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
The language you are thinking of is most probably PHANtom: http://pleiad.cl/phantom But (as author of the language) I think it is overkill to use it for just a memoization cache. Idem for AspectS (I donât know if it works on Pharo though). Right now, I would use MethodWrappers instead, and when Reflectivity is working use that. On Nov 4, 2014, at 1:50 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hi
There is AspectS package at old squeaksource site. I not know is it working in Pharo. And there was presentation at Esug few years ago about another implementation of aspects in Pharo ( i not remember project name)
04 ноÑб. 2014 г. 9:04 полÑзоваÑÐµÐ»Ñ "phil@highoctane.be" <phil@highoctane.be> напиÑал:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
---> Save our in-boxes! http://emailcharter.org <--- Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile
2014-11-04 16:09 GMT+03:00 Johan Fabry <jfabry@dcc.uchile.cl>:
The language you are thinking of is most probably PHANtom: http://pleiad.cl/phantom
Exactly
I have been reading on Ghost: http://esug.org/data/ESUG2011/IWST/PRESENTATIONS/23.Mariano_Peck-Ghost-ESUG2... http://www.slideshare.net/esug/ghost-9095241 http://rmod.lille.inria.fr/archives/workshops/Mart11a-IWST11-Ghost.pdf This link is dead BTW: http://rmod.inria.fr/web/pier/software/Marea/GhostProxies I found a version here: http://www.smalltalkhub.com/#!/~CAR/Ghost/ It isn't in the ConfigurationBrowser, so I wonder where is the version to use. Phil On Tue, Nov 4, 2014 at 2:09 PM, Johan Fabry <jfabry@dcc.uchile.cl> wrote:
The language you are thinking of is most probably PHANtom: http://pleiad.cl/phantom But (as author of the language) I think it is overkill to use it for just a memoization cache. Idem for AspectS (I donât know if it works on Pharo though). Right now, I would use MethodWrappers instead, and when Reflectivity is working use that.
On Nov 4, 2014, at 1:50 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hi
There is AspectS package at old squeaksource site. I not know is it working in Pharo. And there was presentation at Esug few years ago about another implementation of aspects in Pharo ( i not remember project name) 04 ноÑб. 2014 г. 9:04 полÑзоваÑÐµÐ»Ñ "phil@highoctane.be" < phil@highoctane.be> напиÑал:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile
Hi Phil, Ok I missed the details so I've just refreshed my mind. yes the latest repository is this one: http://www.smalltalkhub.com/#!/~CAR/Ghost/ I've just tried in Pharo 3.0 and it works now (yes oups I forgot that it was for Pharo 2.0 ;-)). Ghost is really small so I've just fixed it Try it: ConfigurationOfGhost load Tests are green for me. No I did not push the config in the right place to have it in the ConfigurationBrowser. You can find infos+examples on how to achieve Method wrapper in Mariano's PhD (p116) using Proxies for Methods. https://tel.archives-ouvertes.fr/tel-00764991/document and also look at the test case method named #testSimpleForwardingForMethodUsingBecome Cheers, Luc 2014-11-04 15:48 GMT+01:00 phil@highoctane.be <phil@highoctane.be>:
I have been reading on Ghost:
http://esug.org/data/ESUG2011/IWST/PRESENTATIONS/23.Mariano_Peck-Ghost-ESUG2... http://www.slideshare.net/esug/ghost-9095241 http://rmod.lille.inria.fr/archives/workshops/Mart11a-IWST11-Ghost.pdf
This link is dead BTW: http://rmod.inria.fr/web/pier/software/Marea/GhostProxies
I found a version here: http://www.smalltalkhub.com/#!/~CAR/Ghost/
It isn't in the ConfigurationBrowser, so I wonder where is the version to use.
Phil
On Tue, Nov 4, 2014 at 2:09 PM, Johan Fabry <jfabry@dcc.uchile.cl> wrote:
The language you are thinking of is most probably PHANtom: http://pleiad.cl/phantom But (as author of the language) I think it is overkill to use it for just a memoization cache. Idem for AspectS (I donât know if it works on Pharo though). Right now, I would use MethodWrappers instead, and when Reflectivity is working use that.
On Nov 4, 2014, at 1:50 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hi
There is AspectS package at old squeaksource site. I not know is it working in Pharo. And there was presentation at Esug few years ago about another implementation of aspects in Pharo ( i not remember project name) 04 ноÑб. 2014 г. 9:04 полÑзоваÑÐµÐ»Ñ "phil@highoctane.be" < phil@highoctane.be> напиÑал:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile
On Tue, Nov 4, 2014 at 4:56 PM, Luc Fabresse <luc.fabresse@gmail.com> wrote:
Hi Phil,
Ok I missed the details so I've just refreshed my mind.
yes the latest repository is this one: http://www.smalltalkhub.com/#!/~CAR/Ghost/ I've just tried in Pharo 3.0 and it works now (yes oups I forgot that it was for Pharo 2.0 ;-)). Ghost is really small so I've just fixed it
Thanks a lot!
Try it: ConfigurationOfGhost load Tests are green for me.
I loaded the configuration: Gofer it smalltalkhubUser: 'CAR' project: 'Ghost'; package: 'ConfigurationOfGhost'; load. (#ConfigurationOfGhost asClass project version: #stable) load. Tests are all green.
No I did not push the config in the right place to have it in the ConfigurationBrowser.
I've put it in the Metarepo for 3.0
You can find infos+examples on how to achieve Method wrapper in Mariano's PhD (p116) using Proxies for Methods.
I didn't had that one, thanks!
and also look at the test case method named #testSimpleForwardingForMethodUsingBecome
Yes, seen that.
Cheers,
Much appreciated! Ghost is quite nice and useful. Could do with some more class comments as there is none. I'll try to put in some as I use it. Phil
Luc
2014-11-04 15:48 GMT+01:00 phil@highoctane.be <phil@highoctane.be>:
I have been reading on Ghost:
http://esug.org/data/ESUG2011/IWST/PRESENTATIONS/23.Mariano_Peck-Ghost-ESUG2... http://www.slideshare.net/esug/ghost-9095241 http://rmod.lille.inria.fr/archives/workshops/Mart11a-IWST11-Ghost.pdf
This link is dead BTW: http://rmod.inria.fr/web/pier/software/Marea/GhostProxies
I found a version here: http://www.smalltalkhub.com/#!/~CAR/Ghost/
It isn't in the ConfigurationBrowser, so I wonder where is the version to use.
Phil
On Tue, Nov 4, 2014 at 2:09 PM, Johan Fabry <jfabry@dcc.uchile.cl> wrote:
The language you are thinking of is most probably PHANtom: http://pleiad.cl/phantom But (as author of the language) I think it is overkill to use it for just a memoization cache. Idem for AspectS (I donât know if it works on Pharo though). Right now, I would use MethodWrappers instead, and when Reflectivity is working use that.
On Nov 4, 2014, at 1:50 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hi
There is AspectS package at old squeaksource site. I not know is it working in Pharo. And there was presentation at Esug few years ago about another implementation of aspects in Pharo ( i not remember project name) 04 ноÑб. 2014 г. 9:04 полÑзоваÑÐµÐ»Ñ "phil@highoctane.be" < phil@highoctane.be> напиÑал:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching
around
the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile
Luc, Can you add me to the repo so that I can send updates? Phil On Tue, Nov 4, 2014 at 4:56 PM, Luc Fabresse <luc.fabresse@gmail.com> wrote:
Hi Phil,
Ok I missed the details so I've just refreshed my mind.
yes the latest repository is this one: http://www.smalltalkhub.com/#!/~CAR/Ghost/ I've just tried in Pharo 3.0 and it works now (yes oups I forgot that it was for Pharo 2.0 ;-)). Ghost is really small so I've just fixed it
Try it: ConfigurationOfGhost load Tests are green for me.
No I did not push the config in the right place to have it in the ConfigurationBrowser.
You can find infos+examples on how to achieve Method wrapper in Mariano's PhD (p116) using Proxies for Methods.
https://tel.archives-ouvertes.fr/tel-00764991/document
and also look at the test case method named #testSimpleForwardingForMethodUsingBecome
Cheers,
Luc
2014-11-04 15:48 GMT+01:00 phil@highoctane.be <phil@highoctane.be>:
I have been reading on Ghost:
http://esug.org/data/ESUG2011/IWST/PRESENTATIONS/23.Mariano_Peck-Ghost-ESUG2... http://www.slideshare.net/esug/ghost-9095241 http://rmod.lille.inria.fr/archives/workshops/Mart11a-IWST11-Ghost.pdf
This link is dead BTW: http://rmod.inria.fr/web/pier/software/Marea/GhostProxies
I found a version here: http://www.smalltalkhub.com/#!/~CAR/Ghost/
It isn't in the ConfigurationBrowser, so I wonder where is the version to use.
Phil
On Tue, Nov 4, 2014 at 2:09 PM, Johan Fabry <jfabry@dcc.uchile.cl> wrote:
The language you are thinking of is most probably PHANtom: http://pleiad.cl/phantom But (as author of the language) I think it is overkill to use it for just a memoization cache. Idem for AspectS (I donât know if it works on Pharo though). Right now, I would use MethodWrappers instead, and when Reflectivity is working use that.
On Nov 4, 2014, at 1:50 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hi
There is AspectS package at old squeaksource site. I not know is it working in Pharo. And there was presentation at Esug few years ago about another implementation of aspects in Pharo ( i not remember project name) 04 ноÑб. 2014 г. 9:04 полÑзоваÑÐµÐ»Ñ "phil@highoctane.be" < phil@highoctane.be> напиÑал:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching
around
the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile
just added you as a contributor. And yes comments are more than welcome ;-) #Luc 2014-11-04 18:03 GMT+01:00 phil@highoctane.be <phil@highoctane.be>:
Luc,
Can you add me to the repo so that I can send updates?
Phil
On Tue, Nov 4, 2014 at 4:56 PM, Luc Fabresse <luc.fabresse@gmail.com> wrote:
Hi Phil,
Ok I missed the details so I've just refreshed my mind.
yes the latest repository is this one: http://www.smalltalkhub.com/#!/~CAR/Ghost/ I've just tried in Pharo 3.0 and it works now (yes oups I forgot that it was for Pharo 2.0 ;-)). Ghost is really small so I've just fixed it
Try it: ConfigurationOfGhost load Tests are green for me.
No I did not push the config in the right place to have it in the ConfigurationBrowser.
You can find infos+examples on how to achieve Method wrapper in Mariano's PhD (p116) using Proxies for Methods.
https://tel.archives-ouvertes.fr/tel-00764991/document
and also look at the test case method named #testSimpleForwardingForMethodUsingBecome
Cheers,
Luc
2014-11-04 15:48 GMT+01:00 phil@highoctane.be <phil@highoctane.be>:
I have been reading on Ghost:
http://esug.org/data/ESUG2011/IWST/PRESENTATIONS/23.Mariano_Peck-Ghost-ESUG2... http://www.slideshare.net/esug/ghost-9095241 http://rmod.lille.inria.fr/archives/workshops/Mart11a-IWST11-Ghost.pdf
This link is dead BTW: http://rmod.inria.fr/web/pier/software/Marea/GhostProxies
I found a version here: http://www.smalltalkhub.com/#!/~CAR/Ghost/
It isn't in the ConfigurationBrowser, so I wonder where is the version to use.
Phil
On Tue, Nov 4, 2014 at 2:09 PM, Johan Fabry <jfabry@dcc.uchile.cl> wrote:
The language you are thinking of is most probably PHANtom: http://pleiad.cl/phantom But (as author of the language) I think it is overkill to use it for just a memoization cache. Idem for AspectS (I donât know if it works on Pharo though). Right now, I would use MethodWrappers instead, and when Reflectivity is working use that.
On Nov 4, 2014, at 1:50 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
Hi
There is AspectS package at old squeaksource site. I not know is it working in Pharo. And there was presentation at Esug few years ago about another implementation of aspects in Pharo ( i not remember project name) 04 ноÑб. 2014 г. 9:04 полÑзоваÑÐµÐ»Ñ "phil@highoctane.be" < phil@highoctane.be> напиÑал:
Le 3 nov. 2014 22:13, "Hilaire" <hilaire@drgeo.eu> a écrit :
What's wrong with?
myData ^ data ifNil: [data := self computeMe]
That I do have a lot of places like this and do not want these data littering the code.
Aspects would solve this but we do not have that.
Also I need the mechanism to be removable.
So, I read something about MethodWrapper, ghost, slots... Can't one use any of these things to do this memoization cleanly?
Phil
Le 03/11/2014 16:10, phil@highoctane.be a écrit :
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching
around
the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
-- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile
mutate a literal array ? :D On 3 November 2014 16:10, phil@highoctane.be <phil@highoctane.be> wrote:
How can I do memoization in Pharo?
I mean, a generic mechanism that will help me wrap the caching around the method invocations / messages.
I have expensive calls that do not have to refresh their results as often as they are called.
TIA Phil
participants (8)
-
Damien Pollet -
Denis Kudriashov -
Hilaire -
Johan Fabry -
Luc Fabresse -
Marcus Denker -
Norbert Hartl -
phil@highoctane.be