[Pharo-project] ClassBoxes... bitrotted, or usable?
I mused with a colleague about how I'd like to see "lexically scoped monkey patching", and he pointed me to some guys that want to add that to Ruby (http://timelessrepo.com/refinements-in-ruby). Note the inspiration for their work: ClassBoxes! (http://scg.unibe.ch/research/classboxes) I remember reading the paper years ago, and started working through it again now. Something that's not clear to me is this: does ClassBoxes require VM-side changes? (Because it changes the method lookup, after all, searching packages for methods before working up the inheritance tree.) If so, how invasive are they? If not, do we have a ball-park estimate of how much work it would be to update ClassBoxes to a more recent Squeak/Pharo? I'm more than happy to do the dogwork. I'd just like to know whether I'm signing up for months of work or not. Thanks! frank
Hi Frank, It would be cool to have Classboxes back on track. The original version of Classbox requires a new method lookup. This can be achieved either by modifying the VM or wrapping the method to intercept a call (using method wrapper for example). Interesting variants of classboxes could be realized by: - having a lookup for classes: when you write "Morph new", then the name "Morph" is looked up, pretty much as methods are - having a class Selector that get evaluated into a symbol. You can then achieved selector namespaces, which does not incur a cost at execution. Cheers, Alexandre On Jun 1, 2012, at 10:55 AM, Frank Shearar wrote:
I mused with a colleague about how I'd like to see "lexically scoped monkey patching", and he pointed me to some guys that want to add that to Ruby (http://timelessrepo.com/refinements-in-ruby). Note the inspiration for their work: ClassBoxes! (http://scg.unibe.ch/research/classboxes)
I remember reading the paper years ago, and started working through it again now. Something that's not clear to me is this: does ClassBoxes require VM-side changes? (Because it changes the method lookup, after all, searching packages for methods before working up the inheritance tree.) If so, how invasive are they? If not, do we have a ball-park estimate of how much work it would be to update ClassBoxes to a more recent Squeak/Pharo?
I'm more than happy to do the dogwork. I'd just like to know whether I'm signing up for months of work or not.
Thanks!
frank
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Jun 1, 2012, at 8:08 PM, Alexandre Bergel wrote:
Hi Frank,
It would be cool to have Classboxes back on track.
Now I would like to see a real system like seaside or moose (too complex probably) build and used before.
The original version of Classbox requires a new method lookup. This can be achieved either by modifying the VM or wrapping the method to intercept a call (using method wrapper for example).
Interesting variants of classboxes could be realized by: - having a lookup for classes: when you write "Morph new", then the name "Morph" is looked up, pretty much as methods are - having a class Selector that get evaluated into a symbol. You can then achieved selector namespaces, which does not incur a cost at execution.
what alex wants to say is that in S# dave simmons enhanced symbol with === and namespace.symbol equality was different than symbol equality so it was easy to add selector namespace into the system by just compiling symbol as namespace.symbol so message sends where namespacified. Namespac1 foo self bar => foo self Namespac1 But selector namespaces as well as class boxes are not a panacea because you always find strange beasts. So I'm curious to see what ruby people took for the semantics because we worked with alex 4 years on that and I was not satisfied. Stef
Cheers, Alexandre
On Jun 1, 2012, at 10:55 AM, Frank Shearar wrote:
I mused with a colleague about how I'd like to see "lexically scoped monkey patching", and he pointed me to some guys that want to add that to Ruby (http://timelessrepo.com/refinements-in-ruby). Note the inspiration for their work: ClassBoxes! (http://scg.unibe.ch/research/classboxes)
I remember reading the paper years ago, and started working through it again now. Something that's not clear to me is this: does ClassBoxes require VM-side changes? (Because it changes the method lookup, after all, searching packages for methods before working up the inheritance tree.) If so, how invasive are they? If not, do we have a ball-park estimate of how much work it would be to update ClassBoxes to a more recent Squeak/Pharo?
I'm more than happy to do the dogwork. I'd just like to know whether I'm signing up for months of work or not.
Thanks!
frank
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi - having a class Selector that get evaluated into a symbol. You can then achieved selector namespaces, which does not incur a cost at execution. I do not understand the idea. Could you give an example? Cheers, Jan
Cheers, Alexandre
On Jun 1, 2012, at 10:55 AM, Frank Shearar wrote:
I mused with a colleague about how I'd like to see "lexically scoped monkey patching", and he pointed me to some guys that want to add that to Ruby (http://timelessrepo.com/refinements-in-ruby). Note the inspiration for their work: ClassBoxes! (http://scg.unibe.ch/research/classboxes)
I remember reading the paper years ago, and started working through it again now. Something that's not clear to me is this: does ClassBoxes require VM-side changes? (Because it changes the method lookup, after all, searching packages for methods before working up the inheritance tree.) If so, how invasive are they? If not, do we have a ball-park estimate of how much work it would be to update ClassBoxes to a more recent Squeak/Pharo?
I'm more than happy to do the dogwork. I'd just like to know whether I'm signing up for months of work or not.
Thanks!
frank
Hi jan
- having a class Selector that get evaluated into a symbol. You can then achieved selector namespaces, which does not incur a cost at execution.
Indeed we should just agree that this is the semantics we want for class extensions for example :) Jan did you have a look at http://timelessrepo.com/refinements-in-ruby Because I would like to know if there are more selector or classbox oriented or something else? Stef .
I do not understand the idea. Could you give an example?
Cheers, Jan
Cheers, Alexandre
On Jun 1, 2012, at 10:55 AM, Frank Shearar wrote:
I mused with a colleague about how I'd like to see "lexically scoped monkey patching", and he pointed me to some guys that want to add that to Ruby (http://timelessrepo.com/refinements-in-ruby). Note the inspiration for their work: ClassBoxes! (http://scg.unibe.ch/research/classboxes)
I remember reading the paper years ago, and started working through it again now. Something that's not clear to me is this: does ClassBoxes require VM-side changes? (Because it changes the method lookup, after all, searching packages for methods before working up the inheritance tree.) If so, how invasive are they? If not, do we have a ball-park estimate of how much work it would be to update ClassBoxes to a more recent Squeak/Pharo?
I'm more than happy to do the dogwork. I'd just like to know whether I'm signing up for months of work or not.
Thanks!
frank
On 04/06/12 08:41, Stéphane Ducasse wrote:
Hi jan
- having a class Selector that get evaluated into a symbol. You can then achieved selector namespaces, which does not incur a cost at execution.
Indeed we should just agree that this is the semantics we want for class extensions for example :)
Viewed this way, indeed :-)
Jan did you have a look at http://timelessrepo.com/refinements-in-ruby Because I would like to know if there are more selector or classbox oriented or something else?
Briefly. That post is more a "wow-that's-cool" sort of post rather than in-depth technical report. Looks like classboxes without local rebinding - that's what they say, after all.
Stef .
I do not understand the idea. Could you give an example?
Cheers, Jan
Cheers, Alexandre
On Jun 1, 2012, at 10:55 AM, Frank Shearar wrote:
I mused with a colleague about how I'd like to see "lexically scoped monkey patching", and he pointed me to some guys that want to add that to Ruby (http://timelessrepo.com/refinements-in-ruby). Note the inspiration for their work: ClassBoxes! (http://scg.unibe.ch/research/classboxes)
I remember reading the paper years ago, and started working through it again now. Something that's not clear to me is this: does ClassBoxes require VM-side changes? (Because it changes the method lookup, after all, searching packages for methods before working up the inheritance tree.) If so, how invasive are they? If not, do we have a ball-park estimate of how much work it would be to update ClassBoxes to a more recent Squeak/Pharo?
I'm more than happy to do the dogwork. I'd just like to know whether I'm signing up for months of work or not.
Thanks!
frank
Jan did you have a look at http://timelessrepo.com/refinements-in-ruby Because I would like to know if there are more selector or classbox oriented or something else?
Briefly. That post is more a "wow-that's-cool" sort of post rather than in-depth technical report. Looks like classboxes without local rebinding - that's what they say, after all.
Yes I just read it and it looks more like selectorNamespaces but without any explanations.
This was the implementation in Modular Smalltalk if I remember correctly. In plain Smalltalk you send a message named #msg and the lookup gives you a compile method. In Modular Smalltalk, there is an intermediary step: #msg -> #Namespace.msg -> compile method Alexandre On Jun 4, 2012, at 8:34 AM, Jan Vrany wrote:
Hi
- having a class Selector that get evaluated into a symbol. You can then achieved selector namespaces, which does not incur a cost at execution.
I do not understand the idea. Could you give an example?
Cheers, Jan
Cheers, Alexandre
On Jun 1, 2012, at 10:55 AM, Frank Shearar wrote:
I mused with a colleague about how I'd like to see "lexically scoped monkey patching", and he pointed me to some guys that want to add that to Ruby (http://timelessrepo.com/refinements-in-ruby). Note the inspiration for their work: ClassBoxes! (http://scg.unibe.ch/research/classboxes)
I remember reading the paper years ago, and started working through it again now. Something that's not clear to me is this: does ClassBoxes require VM-side changes? (Because it changes the method lookup, after all, searching packages for methods before working up the inheritance tree.) If so, how invasive are they? If not, do we have a ball-park estimate of how much work it would be to update ClassBoxes to a more recent Squeak/Pharo?
I'm more than happy to do the dogwork. I'd just like to know whether I'm signing up for months of work or not.
Thanks!
frank
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On 04/06/12 22:56, Alexandre Bergel wrote:
This was the implementation in Modular Smalltalk if I remember correctly.
In plain Smalltalk you send a message named #msg and the lookup gives you a compile method. In Modular Smalltalk, there is an intermediary step: #msg -> #Namespace.msg -> compile method
I see. What I do not see is how to achieve this without a cost at runtime. Given that it should support imports. Without imports, SNs are pretty much useless :-) Jan
Alexandre
On Jun 4, 2012, at 8:34 AM, Jan Vrany wrote:
Hi
- having a class Selector that get evaluated into a symbol. You can then achieved selector namespaces, which does not incur a cost at execution.
I do not understand the idea. Could you give an example?
Cheers, Jan
Cheers, Alexandre
On Jun 1, 2012, at 10:55 AM, Frank Shearar wrote:
I mused with a colleague about how I'd like to see "lexically scoped monkey patching", and he pointed me to some guys that want to add that to Ruby (http://timelessrepo.com/refinements-in-ruby). Note the inspiration for their work: ClassBoxes! (http://scg.unibe.ch/research/classboxes)
I remember reading the paper years ago, and started working through it again now. Something that's not clear to me is this: does ClassBoxes require VM-side changes? (Because it changes the method lookup, after all, searching packages for methods before working up the inheritance tree.) If so, how invasive are they? If not, do we have a ball-park estimate of how much work it would be to update ClassBoxes to a more recent Squeak/Pharo?
I'm more than happy to do the dogwork. I'd just like to know whether I'm signing up for months of work or not.
Thanks!
frank
On Jun 5, 2012, at 9:52 AM, Jan Vrany wrote:
On 04/06/12 22:56, Alexandre Bergel wrote:
This was the implementation in Modular Smalltalk if I remember correctly.
In plain Smalltalk you send a message named #msg and the lookup gives you a compile method. In Modular Smalltalk, there is an intermediary step: #msg -> #Namespace.msg -> compile method
I see. What I do not see is how to achieve this without a cost at runtime. Given that it should support imports. Without imports, SNs are pretty much useless :-)
I guess that you are saying that you need a look up between selectornamespace because you can have A>String>>foo ^ 666 A>String>>bar ^ self foo => compiled into A>String>>bar ^ self #A.foo B import A B>String>>foo ^ 42 in B 'ababab' foo -> 42 'ababab' bar =>compiled in ababab' #B.bar should still execute 'ababab' #A.bar since it is not redefined Yes I agree with you. Stef
participants (4)
-
Alexandre Bergel -
Frank Shearar -
Jan Vrany -
Stéphane Ducasse