[ANN] traversal-enabled objects with DeepTraverser
Hi, I put together a little implementation for traversals. It is inspired by an original implementation from Mariano. Using DeepTraverser, you can traverse arbitrary graphs by describing the traversal and by specifying the actions you want to perform on the nodes and relations. The code is available in the Moose image as part of the MooseAlgos subproject, but can also be loaded separately in a Pharo image via: Gofer new url: 'http://www.smalltalkhub.com/mc/Moose/DeepTraverser/main'; package: âConfigurationOfDeepTraverserâ; load. (Smalltalk globals at: #ConfigurationOfDeepTraverser) loadDevelopment. Just to give you an idea, here are some representative examples: Number deep: #subclasses do: [:each | Transcript show: each; cr]. Number deepCollect: #subclasses. Number deep: #subclasses collect: #name. Number deep: #subclasses do: [:each | Transcript show: each; cr] relationDo: [ :from :to | Transcript show: from; show: ' <-- '; show: to; cr ]. More details about the usages and a little description of the implementation can be found here: http://www.humane-assessment.com/blog/traversal-enabled-pharo-objects/ Cheers, Doru -- www.tudorgirba.com "Every thing has its own flow"
On Wed, Dec 11, 2013 at 12:21 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
I put together a little implementation for traversals. It is inspired by an original implementation from Mariano.
Wow... my memory is sooo bad I don't remember ;)
Using DeepTraverser, you can traverse arbitrary graphs by describing the traversal and by specifying the actions you want to perform on the nodes and relations.
Once (or even more times) we thought with Martin 2 things: 1) Reify the traversal in Fuel so that we could plug a different one. 2) Use Fuel only for traversing and allowing user a hook to plug the what to do with each node. 3) Use the same traversal of 2) for deepCopying 4) Use the same traversal of 2) to get an approximate memory consumption of the transitive closure of an object But as always happened we run out of time. Anyway...I think this is a nice area to explore. There are many uses for a nice traverser. Also, did you see we wrote a Rossal extension to print the fuel traversal? http://rmod.lille.inria.fr/web/pier/software/Fuel/Version1.9/Documentation/D... The code is available in the Moose image as part of the MooseAlgos
subproject, but can also be loaded separately in a Pharo image via:
Gofer new url: 'http://www.smalltalkhub.com/mc/Moose/DeepTraverser/main'; package: âConfigurationOfDeepTraverserâ; load. (Smalltalk globals at: #ConfigurationOfDeepTraverser) loadDevelopment.
Just to give you an idea, here are some representative examples:
Number deep: #subclasses do: [:each | Transcript show: each; cr].
Number deepCollect: #subclasses.
Number deep: #subclasses collect: #name.
Number deep: #subclasses do: [:each | Transcript show: each; cr] relationDo: [ :from :to | Transcript show: from; show: ' <-- '; show: to; cr ].
More details about the usages and a little description of the implementation can be found here: http://www.humane-assessment.com/blog/traversal-enabled-pharo-objects/
Cheers, Doru
-- www.tudorgirba.com
"Every thing has its own flow"
-- Mariano http://marianopeck.wordpress.com
Mariano If I would invest in fuel to me the most important aspect is support for evolution of course it is difficult but I always think that if I would sotre code with fuel then in 15 years from now I would love to be able to look at it or I would store an textual representation together with the binary format. Stef On Dec 14, 2013, at 3:44 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Wed, Dec 11, 2013 at 12:21 PM, Tudor Girba <tudor@tudorgirba.com> wrote: Hi,
I put together a little implementation for traversals. It is inspired by an original implementation from Mariano.
Wow... my memory is sooo bad I don't remember ;)
Using DeepTraverser, you can traverse arbitrary graphs by describing the traversal and by specifying the actions you want to perform on the nodes and relations.
Once (or even more times) we thought with Martin 2 things:
1) Reify the traversal in Fuel so that we could plug a different one. 2) Use Fuel only for traversing and allowing user a hook to plug the what to do with each node. 3) Use the same traversal of 2) for deepCopying 4) Use the same traversal of 2) to get an approximate memory consumption of the transitive closure of an object
But as always happened we run out of time.
Anyway...I think this is a nice area to explore. There are many uses for a nice traverser.
Also, did you see we wrote a Rossal extension to print the fuel traversal? http://rmod.lille.inria.fr/web/pier/software/Fuel/Version1.9/Documentation/D...
The code is available in the Moose image as part of the MooseAlgos subproject, but can also be loaded separately in a Pharo image via:
Gofer new url: 'http://www.smalltalkhub.com/mc/Moose/DeepTraverser/main'; package: âConfigurationOfDeepTraverserâ; load. (Smalltalk globals at: #ConfigurationOfDeepTraverser) loadDevelopment.
Just to give you an idea, here are some representative examples:
Number deep: #subclasses do: [:each | Transcript show: each; cr].
Number deepCollect: #subclasses.
Number deep: #subclasses collect: #name.
Number deep: #subclasses do: [:each | Transcript show: each; cr] relationDo: [ :from :to | Transcript show: from; show: ' <-- '; show: to; cr ].
More details about the usages and a little description of the implementation can be found here: http://www.humane-assessment.com/blog/traversal-enabled-pharo-objects/
Cheers, Doru
-- www.tudorgirba.com
"Every thing has its own flow"
-- Mariano http://marianopeck.wordpress.com
Hi, On Sat, Dec 14, 2013 at 3:44 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
On Wed, Dec 11, 2013 at 12:21 PM, Tudor Girba <tudor@tudorgirba.com>wrote:
Hi,
I put together a little implementation for traversals. It is inspired by an original implementation from Mariano.
Wow... my memory is sooo bad I don't remember ;)
I asked once for something that can compute the size of an object, and you sent me a GraphTraverser class. I extended this concept and generalized it a bit.
Using DeepTraverser, you can traverse arbitrary graphs by describing the traversal and by specifying the actions you want to perform on the nodes and relations.
Once (or even more times) we thought with Martin 2 things:
1) Reify the traversal in Fuel so that we could plug a different one. 2) Use Fuel only for traversing and allowing user a hook to plug the what to do with each node. 3) Use the same traversal of 2) for deepCopying 4) Use the same traversal of 2) to get an approximate memory consumption of the transitive closure of an object
This would be great.
But as always happened we run out of time.
Anyway...I think this is a nice area to explore. There are many uses for a nice traverser.
Agreed. It would be great to build on DeepTraverser and make it more powerful. Also, did you see we wrote a Rossal extension to print the fuel traversal?
http://rmod.lille.inria.fr/web/pier/software/Fuel/Version1.9/Documentation/D...
Yes. That is cool :) Doru
The code is available in the Moose image as part of the MooseAlgos
subproject, but can also be loaded separately in a Pharo image via:
Gofer new url: 'http://www.smalltalkhub.com/mc/Moose/DeepTraverser/main'; package: âConfigurationOfDeepTraverserâ; load. (Smalltalk globals at: #ConfigurationOfDeepTraverser) loadDevelopment.
Just to give you an idea, here are some representative examples:
Number deep: #subclasses do: [:each | Transcript show: each; cr].
Number deepCollect: #subclasses.
Number deep: #subclasses collect: #name.
Number deep: #subclasses do: [:each | Transcript show: each; cr] relationDo: [ :from :to | Transcript show: from; show: ' <-- '; show: to; cr ].
More details about the usages and a little description of the implementation can be found here: http://www.humane-assessment.com/blog/traversal-enabled-pharo-objects/
Cheers, Doru
-- www.tudorgirba.com
"Every thing has its own flow"
-- Mariano http://marianopeck.wordpress.com
-- www.tudorgirba.com "Every thing has its own flow"
Hi, I looked a bit at the existing hardcoded traversal methods in a Pharo/Moose image. To detect it, I used a traversal. Perhaps this can also be useful for people that want to teach what a traversal is, or what an analysis is, so I wrote a blog post about it: http://www.humane-assessment.com/blog/looking-for-hardcoded-traversal-method... Cheers, Doru On Sat, Dec 14, 2013 at 3:44 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
On Wed, Dec 11, 2013 at 12:21 PM, Tudor Girba <tudor@tudorgirba.com>wrote:
Hi,
I put together a little implementation for traversals. It is inspired by an original implementation from Mariano.
Wow... my memory is sooo bad I don't remember ;)
Using DeepTraverser, you can traverse arbitrary graphs by describing the traversal and by specifying the actions you want to perform on the nodes and relations.
Once (or even more times) we thought with Martin 2 things:
1) Reify the traversal in Fuel so that we could plug a different one. 2) Use Fuel only for traversing and allowing user a hook to plug the what to do with each node. 3) Use the same traversal of 2) for deepCopying 4) Use the same traversal of 2) to get an approximate memory consumption of the transitive closure of an object
But as always happened we run out of time.
Anyway...I think this is a nice area to explore. There are many uses for a nice traverser.
Also, did you see we wrote a Rossal extension to print the fuel traversal?
http://rmod.lille.inria.fr/web/pier/software/Fuel/Version1.9/Documentation/D...
The code is available in the Moose image as part of the MooseAlgos
subproject, but can also be loaded separately in a Pharo image via:
Gofer new url: 'http://www.smalltalkhub.com/mc/Moose/DeepTraverser/main'; package: âConfigurationOfDeepTraverserâ; load. (Smalltalk globals at: #ConfigurationOfDeepTraverser) loadDevelopment.
Just to give you an idea, here are some representative examples:
Number deep: #subclasses do: [:each | Transcript show: each; cr].
Number deepCollect: #subclasses.
Number deep: #subclasses collect: #name.
Number deep: #subclasses do: [:each | Transcript show: each; cr] relationDo: [ :from :to | Transcript show: from; show: ' <-- '; show: to; cr ].
More details about the usages and a little description of the implementation can be found here: http://www.humane-assessment.com/blog/traversal-enabled-pharo-objects/
Cheers, Doru
-- www.tudorgirba.com
"Every thing has its own flow"
-- Mariano http://marianopeck.wordpress.com
-- www.tudorgirba.com "Every thing has its own flow"
This is a short and well post! I would have imagined more transversal are in the VM. I know Roassal has some Alexandre On Dec 16, 2013, at 12:47 AM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
I looked a bit at the existing hardcoded traversal methods in a Pharo/Moose image. To detect it, I used a traversal. Perhaps this can also be useful for people that want to teach what a traversal is, or what an analysis is, so I wrote a blog post about it: http://www.humane-assessment.com/blog/looking-for-hardcoded-traversal-method...
Cheers, Doru
On Sat, Dec 14, 2013 at 3:44 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Wed, Dec 11, 2013 at 12:21 PM, Tudor Girba <tudor@tudorgirba.com> wrote: Hi,
I put together a little implementation for traversals. It is inspired by an original implementation from Mariano.
Wow... my memory is sooo bad I don't remember ;)
Using DeepTraverser, you can traverse arbitrary graphs by describing the traversal and by specifying the actions you want to perform on the nodes and relations.
Once (or even more times) we thought with Martin 2 things:
1) Reify the traversal in Fuel so that we could plug a different one. 2) Use Fuel only for traversing and allowing user a hook to plug the what to do with each node. 3) Use the same traversal of 2) for deepCopying 4) Use the same traversal of 2) to get an approximate memory consumption of the transitive closure of an object
But as always happened we run out of time.
Anyway...I think this is a nice area to explore. There are many uses for a nice traverser.
Also, did you see we wrote a Rossal extension to print the fuel traversal? http://rmod.lille.inria.fr/web/pier/software/Fuel/Version1.9/Documentation/D...
The code is available in the Moose image as part of the MooseAlgos subproject, but can also be loaded separately in a Pharo image via:
Gofer new url: 'http://www.smalltalkhub.com/mc/Moose/DeepTraverser/main'; package: âConfigurationOfDeepTraverserâ; load. (Smalltalk globals at: #ConfigurationOfDeepTraverser) loadDevelopment.
Just to give you an idea, here are some representative examples:
Number deep: #subclasses do: [:each | Transcript show: each; cr].
Number deepCollect: #subclasses.
Number deep: #subclasses collect: #name.
Number deep: #subclasses do: [:each | Transcript show: each; cr] relationDo: [ :from :to | Transcript show: from; show: ' <-- '; show: to; cr ].
More details about the usages and a little description of the implementation can be found here: http://www.humane-assessment.com/blog/traversal-enabled-pharo-objects/
Cheers, Doru
-- www.tudorgirba.com
"Every thing has its own flow"
-- Mariano http://marianopeck.wordpress.com
-- www.tudorgirba.com
"Every thing has its own flow" _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
participants (4)
-
Alexandre Bergel -
Mariano Martinez Peck -
Stéphane Ducasse -
Tudor Girba