[squeak-dev] Future of Squeak, and outsider's view

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
43 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Future of Squeak, and outsider's view

Klaus D. Witzel
On Tue, 30 Jun 2009 07:15:37 +0200, Igor Stasenko wrote:

> Since multiple people seem don't grok my example, let me simplify it a  
> bit:
>
> Suppose you have a special collection of objects over which you can  
> iterate.
>
> The items in that collection could be anything - you don't really care
> on almost any of them, except those ones which is also a special
> collections of same kind as a container.
>
> so, then you could have a method, which by iterating through your
> special collection, ignores all objects except those who
> also can be iterated in same manner:
>
> MySpecialCollection>>mySpecialCollect: aBlock
>      ^ self collect: [:each |
>           each isMySpecialCollection ifTrue: [ each mySpecialCollect:
> aBlock] ifFalse: [each]
>       ]

In _any_ Smalltalk, (each respondsTo: #mySpecialCollect:) is what you want.

>


--
"If at first, the idea is not absurd, then there is no hope for it".  
Albert Einstein


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Future of Squeak, and outsider's view

Cameron Sanders-2
In reply to this post by Igor Stasenko
You're right. And I have a similar situation in some of my code right  
now, which is why i piped up earlier.  I have two or three examples in  
my code. The first is a container (financial series) that holds  
Numbers or something else. Under mathematical operations, my financial  
series will operate on the numbers only, and simply replace anything  
else with a FaNullDatum (singleton) -- FaNullDatum has its own  
printing/display methods, and it knows nothing about mathematical  
operations.

A second example in my code addresses what is mentioned below. But for  
this aspect, I know that all of the candidate objects were defined  
under a certain tree that implements a #canCompute: method, or that  
objects wishing to be substituted will implement the method. That way  
I don't have to worry about how it is implemented (e.g.  
#doesNotUnderstand:) and whether it will be in the method dictionary.

So... obviously, "existing" objects can be substituted... but now I am  
re-thinking the generality of these objects. Perhaps I can loosen this  
constraint -- even though I am not convinced it would ever matter for  
my situation. (Mine are FinancialAnalyst objects that know how to  
operate on my set of financial data keys.)

... i need to look into Traits.

Ciao,
Cam

On Jun 30, 2009, at 12:46 AM, Igor Stasenko wrote:

> Concerning #respondsTo: - its also smells a bit, because you are
> depending not on a specific behavior (by invoking some method) but
> rather testing the class method dictionary, which is mostly static.
> This approach (use of #respondsTo:) also doesn't fits well with
> proxies (and we need them sometimes).


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Future of Squeak, and outsider's view

Cameron Sanders-2
correction... with apologies:

The word "not" is missing from the first line of the second paragraph  
illustrated below.

On Jun 30, 2009, at 1:28 AM, Cameron Sanders wrote:

> A second example in my code addresses what is mentioned below. But  
> for this aspect, I know that all of the candidate objects were  
> defined under a certain tree that implements a #canCompute: method,  
> or that objects wishing to be substituted will implement the method.  
> That way I don't have to worry about how it is implemented (e.g.  
> #doesNotUnderstand:) and whether it will be in the method dictionary.
>
> So... obviously, "existing" objects can be substituted... but now I  
> am re-thinking the generality of these objects. Perhaps I can loosen  
> this constraint -- even though I am not convinced it would ever  
> matter for my situation. (Mine are FinancialAnalyst objects that  
> know how to operate on my set of financial data keys.)


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Igor Stasenko
In reply to this post by Klaus D. Witzel
2009/6/30 Klaus D. Witzel <[hidden email]>:

> On Tue, 30 Jun 2009 07:15:37 +0200, Igor Stasenko wrote:
>
>> Since multiple people seem don't grok my example, let me simplify it a
>> bit:
>>
>> Suppose you have a special collection of objects over which you can
>> iterate.
>>
>> The items in that collection could be anything - you don't really care
>> on almost any of them, except those ones which is also a special
>> collections of same kind as a container.
>>
>> so, then you could have a method, which by iterating through your
>> special collection, ignores all objects except those who
>> also can be iterated in same manner:
>>
>> MySpecialCollection>>mySpecialCollect: aBlock
>>     ^ self collect: [:each |
>>          each isMySpecialCollection ifTrue: [ each mySpecialCollect:
>> aBlock] ifFalse: [each]
>>      ]
>
> In _any_ Smalltalk, (each respondsTo: #mySpecialCollect:) is what you want.
>

where the guarantees that some completely different class does not
implements such method with completely different behavior?

>>
>
>
> --
> "If at first, the idea is not absurd, then there is no hope for it". Albert
> Einstein
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Future of Squeak, and outsider's view

Klaus D. Witzel
On Tue, 30 Jun 2009 16:39:43 +0200, Igor Stasenko wrote:

> 2009/6/30 Klaus D. Witzel :
...

>>> so, then you could have a method, which by iterating through your
>>> special collection, ignores all objects except those who
>>> also can be iterated in same manner:
>>>
>>> MySpecialCollection>>mySpecialCollect: aBlock
>>>     ^ self collect: [:each |
>>>          each isMySpecialCollection ifTrue: [ each mySpecialCollect:
>>> aBlock] ifFalse: [each]
>>>      ]
>>
>> In _any_ Smalltalk, (each respondsTo: #mySpecialCollect:) is what you  
>> want.
>>
>
> where the guarantees that some completely different class does not
> implements such method with completely different behavior?

Yes, I know, and I know your other requirements from CVLambda as well :)  
the answer is :

1] you want to reflect on every possible class/behavior

2] you don't want to reflect on 1] as well

Shall I write 3] or was this already Okay ;)

/Klaus


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Igor Stasenko
2009/6/30 Klaus D. Witzel <[hidden email]>:

> On Tue, 30 Jun 2009 16:39:43 +0200, Igor Stasenko wrote:
>
>> 2009/6/30 Klaus D. Witzel :
>
> ...
>>>>
>>>> so, then you could have a method, which by iterating through your
>>>> special collection, ignores all objects except those who
>>>> also can be iterated in same manner:
>>>>
>>>> MySpecialCollection>>mySpecialCollect: aBlock
>>>>     ^ self collect: [:each |
>>>>          each isMySpecialCollection ifTrue: [ each mySpecialCollect:
>>>> aBlock] ifFalse: [each]
>>>>      ]
>>>
>>> In _any_ Smalltalk, (each respondsTo: #mySpecialCollect:) is what you
>>> want.
>>>
>>
>> where the guarantees that some completely different class does not
>> implements such method with completely different behavior?
>
> Yes, I know, and I know your other requirements from CVLambda as well :) the
> answer is :
>
> 1] you want to reflect on every possible class/behavior
>
> 2] you don't want to reflect on 1] as well
>
> Shall I write 3] or was this already Okay ;)
>

Sorry, can't understand. A meaning of 'reflect on'  doesn't fits well
with my non-english mindset :)

> /Klaus
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Future of Squeak, and outsider's view

Eliot Miranda-2
In reply to this post by Igor Stasenko


On Mon, Jun 29, 2009 at 8:59 PM, Igor Stasenko <[hidden email]> wrote:
2009/6/30 Cameron Sanders <[hidden email]>:
> What you write (down below) is close to what I was thinking when I said have
> all #isXXX return false by default;
> although I would test that the first two characters match 'i' and 's' and
> that more characters exist, if so, return false, otherwise, normal
> #doesNotUnderstand: behavior.
>
> I would treat #is by itself differently... it is ... or it couldn't be
> tested! So I would do nothing for simple #is. and I don't like #is: because
> it looks like a class type test... but that is part of the point, eh?
>

I wouldn't say that. It is more trait-based approach than class-based.

The concept of #is: are: When object foo having some trait, it should
answer true on 'foo is: sometrait ', otherwise false.
Obviously since most subclasses inherit the behavior & traits of base
class, you should honor this rule in overrides of #is: method
i.e.:

Someclass>>is: object
 ^ (your tests here) or: [ super is: object ]

otherwise, if you omit the super send, some of the traits will become
unavailable. But of course, except when you doing this intentionally.


> I'll have to go back to the original example (by [hidden email], and
> read more about lambdas) but I thought that CVLambda would implement
> #isCVLambda  to return true when it can be verified to be one. The example
> did not illustrate #doesNotUnderstand:.
>
> Back to the question of adding behavior to classes that you don't own.
> VisualWorks has a means to extend a class in a different package ... as I
> recall. As I recall, squeak has no such capability, right?
>

MC having this capability for a years.

Arguably not.  (BTW VW has had it from 98).  The crucial difference is that in VW an extension can be in more than one package.  In Squeak a selector can only be in a single Monticello extension category.  That leads to the awful bug that when an MC package patches a base selector to extend it to fix a bug it ends up in the package and its membership of the package it was in previously being lost.  I understand that with method history this situation can be detected but if you e.g. condense changes then that history is lost, and the base package selector becomes only an extension  Ouch.

The VW "solution" is OK as far as it goes; a package is a set of class, selector pairs (more than this, but this is the essence).  An MC package is defined by class and method categories.  VW's parcels are intensional, MC packages are extensional.  There's a tension in both; many VW'ers want, at least at the UI level, for packages to be extensional, but precision (knowing whether something is in a package or not, allowing things to be in more than one package so that one can include patches, etc) requires an intentional construct.

When you also provide selector namespaces I don't think the situation changes because one still needs patches in the absence of a perfectly designed system.  So IMO somehow MC needs to move to an intensional package definition, at least for extensions ;)




> Thanks. You have given me food for thought...
>
> Ciao,
> Cam
>
> On Jun 29, 2009, at 3:43 PM, David Goehrig wrote:
>
>> What I typically what I've been doing to eliminate all of these methods
>> with a single simple change:
>>
>> Object
>>   doesNoUnderstand: aMessage
>>       ^ false
>
>
>



--
Best regards,
Igor Stasenko AKA sig.




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Future of Squeak, and outsider's view

Igor Stasenko
2009/6/30 Eliot Miranda <[hidden email]>:

>
>
> On Mon, Jun 29, 2009 at 8:59 PM, Igor Stasenko <[hidden email]> wrote:
>>
>> 2009/6/30 Cameron Sanders <[hidden email]>:
>> > What you write (down below) is close to what I was thinking when I said
>> > have
>> > all #isXXX return false by default;
>> > although I would test that the first two characters match 'i' and 's'
>> > and
>> > that more characters exist, if so, return false, otherwise, normal
>> > #doesNotUnderstand: behavior.
>> >
>> > I would treat #is by itself differently... it is ... or it couldn't be
>> > tested! So I would do nothing for simple #is. and I don't like #is:
>> > because
>> > it looks like a class type test... but that is part of the point, eh?
>> >
>>
>> I wouldn't say that. It is more trait-based approach than class-based.
>>
>> The concept of #is: are: When object foo having some trait, it should
>> answer true on 'foo is: sometrait ', otherwise false.
>> Obviously since most subclasses inherit the behavior & traits of base
>> class, you should honor this rule in overrides of #is: method
>> i.e.:
>>
>> Someclass>>is: object
>>  ^ (your tests here) or: [ super is: object ]
>>
>> otherwise, if you omit the super send, some of the traits will become
>> unavailable. But of course, except when you doing this intentionally.
>>
>>
>> > I'll have to go back to the original example (by [hidden email], and
>> > read more about lambdas) but I thought that CVLambda would implement
>> > #isCVLambda  to return true when it can be verified to be one. The
>> > example
>> > did not illustrate #doesNotUnderstand:.
>> >
>> > Back to the question of adding behavior to classes that you don't own.
>> > VisualWorks has a means to extend a class in a different package ... as
>> > I
>> > recall. As I recall, squeak has no such capability, right?
>> >
>>
>> MC having this capability for a years.
>
> Arguably
> not.  (BTW VW has had it from 98).  The crucial difference is that in
> VW an extension can be in more than one package.  In Squeak a selector can
> only be in a single Monticello extension category.  That leads to the awful
> bug that when an MC package patches a base selector to extend it to fix a
> bug it ends up in the package and its membership of the package it was in
> previously being lost.  I understand that with method history this situation
> can be detected but if you e.g. condense changes then that history is lost,
> and the base package selector becomes only an extension  Ouch.
> The VW "solution" is OK as far as it goes; a package is a set of class,
> selector pairs (more than this, but this is the essence).  An MC package is
> defined by class and method categories.  VW's parcels are intensional, MC
> packages are extensional.  There's a tension in both; many VW'ers want, at
> least at the UI level, for packages to be extensional, but precision
> (knowing whether something is in a package or not, allowing things to be in
> more than one package so that one can include patches, etc) requires an
> intentional construct.
> When you also provide selector namespaces I don't think the situation
> changes because one still needs patches in the absence of a perfectly
> designed system.  So IMO somehow MC needs to move to an intensional package
> definition, at least for extensions ;)
>

i just wanted to point that MC having an extension mechanism. Yes, it
is different from VW one.
And in the light of your description - it is done wrong (at least for
me), but its still can be called 'extension mechanism' :)

>>
>>
>> > Thanks. You have given me food for thought...
>> >
>> > Ciao,
>> > Cam
>> >
>> > On Jun 29, 2009, at 3:43 PM, David Goehrig wrote:
>> >
>> >> What I typically what I've been doing to eliminate all of these methods
>> >> with a single simple change:
>> >>
>> >> Object
>> >>   doesNoUnderstand: aMessage
>> >>       ^ false
>> >
>> >
>> >
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>
>
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Future of Squeak, and outsider's view

Eliot Miranda-2


On Tue, Jun 30, 2009 at 10:33 AM, Igor Stasenko <[hidden email]> wrote:
2009/6/30 Eliot Miranda <[hidden email]>:
>
>
> On Mon, Jun 29, 2009 at 8:59 PM, Igor Stasenko <[hidden email]> wrote:
>>
>> 2009/6/30 Cameron Sanders <[hidden email]>:
>> > What you write (down below) is close to what I was thinking when I said
>> > have
>> > all #isXXX return false by default;
>> > although I would test that the first two characters match 'i' and 's'
>> > and
>> > that more characters exist, if so, return false, otherwise, normal
>> > #doesNotUnderstand: behavior.
>> >
>> > I would treat #is by itself differently... it is ... or it couldn't be
>> > tested! So I would do nothing for simple #is. and I don't like #is:
>> > because
>> > it looks like a class type test... but that is part of the point, eh?
>> >
>>
>> I wouldn't say that. It is more trait-based approach than class-based.
>>
>> The concept of #is: are: When object foo having some trait, it should
>> answer true on 'foo is: sometrait ', otherwise false.
>> Obviously since most subclasses inherit the behavior & traits of base
>> class, you should honor this rule in overrides of #is: method
>> i.e.:
>>
>> Someclass>>is: object
>>  ^ (your tests here) or: [ super is: object ]
>>
>> otherwise, if you omit the super send, some of the traits will become
>> unavailable. But of course, except when you doing this intentionally.
>>
>>
>> > I'll have to go back to the original example (by [hidden email], and
>> > read more about lambdas) but I thought that CVLambda would implement
>> > #isCVLambda  to return true when it can be verified to be one. The
>> > example
>> > did not illustrate #doesNotUnderstand:.
>> >
>> > Back to the question of adding behavior to classes that you don't own.
>> > VisualWorks has a means to extend a class in a different package ... as
>> > I
>> > recall. As I recall, squeak has no such capability, right?
>> >
>>
>> MC having this capability for a years.
>
> Arguably
> not.  (BTW VW has had it from 98).  The crucial difference is that in
> VW an extension can be in more than one package.  In Squeak a selector can
> only be in a single Monticello extension category.  That leads to the awful
> bug that when an MC package patches a base selector to extend it to fix a
> bug it ends up in the package and its membership of the package it was in
> previously being lost.  I understand that with method history this situation
> can be detected but if you e.g. condense changes then that history is lost,
> and the base package selector becomes only an extension  Ouch.
> The VW "solution" is OK as far as it goes; a package is a set of class,
> selector pairs (more than this, but this is the essence).  An MC package is
> defined by class and method categories.  VW's parcels are intensional, MC
> packages are extensional.  There's a tension in both; many VW'ers want, at
> least at the UI level, for packages to be extensional, but precision
> (knowing whether something is in a package or not, allowing things to be in
> more than one package so that one can include patches, etc) requires an
> intentional construct.
> When you also provide selector namespaces I don't think the situation
> changes because one still needs patches in the absence of a perfectly
> designed system.  So IMO somehow MC needs to move to an intensional package
> definition, at least for extensions ;)
>

i just wanted to point that MC having an extension mechanism. Yes, it
is different from VW one.
And in the light of your description - it is done wrong (at least for
me), but its still can be called 'extension mechanism' :)

then +1 :)
 


>>
>>
>> > Thanks. You have given me food for thought...
>> >
>> > Ciao,
>> > Cam
>> >
>> > On Jun 29, 2009, at 3:43 PM, David Goehrig wrote:
>> >
>> >> What I typically what I've been doing to eliminate all of these methods
>> >> with a single simple change:
>> >>
>> >> Object
>> >>   doesNoUnderstand: aMessage
>> >>       ^ false
>> >
>> >
>> >
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>
>
>
>
>



--
Best regards,
Igor Stasenko AKA sig.




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Future of Squeak, and outsider's view

Göran Krampe
In reply to this post by Eliot Miranda-2
Hi!

Eliot Miranda wrote:

> Arguably
> not.  (BTW VW has had it from 98).  The crucial difference is that in
> VW an extension can be in more than one package.  In Squeak a selector can
> only be in a single Monticello extension category.  That leads to the awful
> bug that when an MC package patches a base selector to extend it to fix a
> bug it ends up in the package and its membership of the package it was in
> previously being lost.  I understand that with method history this situation
> can be detected but if you e.g. condense changes then that history is lost,
> and the base package selector becomes only an extension  Ouch.
>
> The VW "solution" is OK as far as it goes; a package is a set of class,
> selector pairs (more than this, but this is the essence).  An MC package is
> defined by class and method categories.  VW's parcels are intensional, MC
> packages are extensional.  There's a tension in both; many VW'ers want, at
> least at the UI level, for packages to be extensional, but precision
> (knowing whether something is in a package or not, allowing things to be in
> more than one package so that one can include patches, etc) requires an
> intentional construct.
>
> When you also provide selector namespaces I don't think the situation
> changes because one still needs patches in the absence of a perfectly
> designed system.  So IMO somehow MC needs to move to an intensional package
> definition, at least for extensions ;)

Now, yet again I pull out from my hat... DeltaStreams! :)

If a package was defined as a Delta, then - since a Delta is a
*completely standalone object* - you can never lose any information by
loading another Delta into the image. NOTE: Loading is not the same as
applying.

So if you have 2 Deltas loaded into the image (no changes have yet been
made to the image!) you can analyze them and discover that they both
include SomeClass>>someMethod - with conflicting code in them (otherwise
we would still be kinda ok).

If you would proceed and apply first one (=make the changes to the
image) and then the other you would of course end up with the last
version of that specific method.

But fact remains - Deltas are *standalone* and can be loaded *before*
you actually apply them. And you can revert them if all their changes
are revertable.

Deltas can thus also be used as a "quilt" system (like Mercurial queues)
where you can juggle Deltas and "shelf" / "unshelf" stuff etc.

Sorry, just couldn't help mentioning it.

regards, Göran


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Future of Squeak, and outsider's view

Andreas.Raab
In reply to this post by Eliot Miranda-2
Eliot Miranda wrote:
> Arguably not.  (BTW VW has had it from 98).  The crucial difference is that
> in VW an extension can be in more than one package.  In Squeak a selector
> can only be in a single Monticello extension category.  That leads to
> the awful bug that when an MC package patches a base selector to extend
> it to fix a bug it ends up in the package and its membership of the
> package it was in previously being lost.  I understand that with method
> history this situation can be detected but if you e.g. condense changes
> then that history is lost, and the base package selector becomes only an
> extension  Ouch.

That's a bug in condenseChanges, not a conceptual problem. BTW, I really
fail to see how it would make any difference whatsoever if extension
methods are in multiple packages or not. In either case you are
*completely* screwed if you have multiple packages trying to extend the
same method. Seriously, has there ever been a situation where that
actually works? (my personal preference is actually that MC should blow
up straight into your face if you try to change a method that's in an
extension category already, but that's just me - I generally avoid
extensions like the plague)

> The VW "solution" is OK as far as it goes; a package is a set of class,
> selector pairs (more than this, but this is the essence).  An MC package
> is defined by class and method categories.  VW's parcels are
> intensional, MC packages are extensional.

I don't understand the distinction you are making between intensional
and extensional. Care to elaborate?

MC internally actually uses a set of class and selector pairs as well,
it just derives them via PackageInfo from categories. And it most
certainly can have methods in multiple packages. For example, if you add
a method in category '*Foo-Bar-Baz' it will be part of the packages
'Foo-Bar-Baz', 'Foo-Bar' and 'Foo' (if those exist).

The only thing that prevents you from having other combinations of
multiple package memberships is that there is no UI that allows you to
specify which combinations of packages a method should be part of. The
category hack is great because it works with existing tools, but
existing tools don't allow for methods in multiple categories. If you
fix that you get your multiple package membership in Monticello for
free. Alternatively provide a UI to specify which other packages the
method should be part of, and you're there, too.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Stéphane Rollandin
> The only thing that prevents you from having other combinations of
> multiple package memberships is that there is no UI that allows you to
> specify which combinations of packages a method should be part of. The
> category hack is great because it works with existing tools, but
> existing tools don't allow for methods in multiple categories. If you
> fix that you get your multiple package membership in Monticello for
> free. Alternatively provide a UI to specify which other packages the
> method should be part of, and you're there, too.

That would be very useful !

Stef


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Eliot Miranda-2
In reply to this post by Andreas.Raab


On Tue, Jun 30, 2009 at 11:37 AM, Andreas Raab <[hidden email]> wrote:
Eliot Miranda wrote:
Arguably not.  (BTW VW has had it from 98).  The crucial difference is that
in VW an extension can be in more than one package.  In Squeak a selector can only be in a single Monticello extension category.  That leads to the awful bug that when an MC package patches a base selector to extend it to fix a bug it ends up in the package and its membership of the package it was in previously being lost.  I understand that with method history this situation can be detected but if you e.g. condense changes then that history is lost, and the base package selector becomes only an extension  Ouch.

That's a bug in condenseChanges, not a conceptual problem. BTW, I really fail to see how it would make any difference whatsoever if extension methods are in multiple packages or not. In either case you are *completely* screwed if you have multiple packages trying to extend the same method. Seriously, has there ever been a situation where that actually works? (my personal preference is actually that MC should blow up straight into your face if you try to change a method that's in an extension category already, but that's just me - I generally avoid extensions like the plague)

I don't avoid extensions, and personally feel extensions are a core part of building frameworks.  If objects are to interact they must provide protocol to support that interaction.  In adding a new framework to an existing system this means extending existing objects so that they can interact with the new framework.  Yes, one can do this badly, but there are lots of examples where this makes sense.

As far as patching, we've had this conversation before.  I agree that a well-designed system will provide extension mechanisms that make patching unnecessary.  But unless the designer has excellent foresight (which is more difficult the further forward in time one projects) then there will be areas of the system which have to be patched.  If two packages need to patch the same method then there is a problem, but one is not totally screwed.  Provided that both packages have the same patch then they are compatible.  That means that one can load package A and get the patch, load package B and get the patch and load bth packages and get the patch provided it is identical in both packages.  Seems fine to me, and much more desirable than requiring extra-package management of the patch (e.g. "please file-in this changeset before loading the package") because that extra-package stuff will get lost, or ignored and then you're screwed too.

So for me handling extensions in packages in robust ways is about the system pragmatically supporting real practice, rather than enforcing ideals which one should strive for but are costly to arrive at and must be evolved towards in practice.

The VW "solution" is OK as far as it goes; a package is a set of class, selector pairs (more than this, but this is the essence).  An MC package is defined by class and method categories.  VW's parcels are intensional, MC packages are extensional.

I don't understand the distinction you are making between intensional and extensional. Care to elaborate?

I hope I've got this the right way round.  An extensional concept is one where a rule selects the members, e.g. the set of all sets is an extentionally defined set.  An intentional concept is where individual members are defined as such, so A labrador is a dog is an intentional definition.  MC packages are extensional; the methods on a class in a category of the package are all the methods on the class that are not otherwise categorised in category extensions of other packages and whose history does not include a non-extension category.  VW parcels are intentional; the methods in a parcel are those that are explicitly listed in the parcel.  A parcel has a Dictionary of class to set of selector for each class with methods in the parcel.

I think its clear that the extensional approach is more convenient and provides a nicer UI because (especially in MC's use of the existing categorisation scheme) it dovetails with the existing programming facilities.  It is tedious to have to add a method to a package every time one defines one.  An extensional approach allows the adding to be implicit.  But as I've said earlier in the thread the extensional approach has problems when it comes to managing multiple packages that can overlap (as I think s inevitable in imperfect complex systems).  So I would argue for the physical implementation of a package, and an extension mechanism ot be intentional, but for the UI to be extensional, so that e.g. when one is in a particular project all methods get added to the project's current package without programmer intervention.  One still needs additional tools that allow interacting with the intentional nature of things (much like the change set browser allows in moving changes between sets), but largely one can have one's cake and eat it too if the UI i extensional but packages are intentional.


MC internally actually uses a set of class and selector pairs as well, it just derives them via PackageInfo from categories. And it most certainly can have methods in multiple packages. For example, if you add a method in category '*Foo-Bar-Baz' it will be part of the packages 'Foo-Bar-Baz', 'Foo-Bar' and 'Foo' (if those exist).

No it doesn't.  The list is an internal representation used merely in recording the set of methods in question.  But that set is compyted by an extensional approach by applying a category pattern to the system as it exists currently and writing that projection of the rule out.
 
The only thing that prevents you from having other combinations of multiple package memberships is that there is no UI that allows you to specify which combinations of packages a method should be part of. The category hack is great because it works with existing tools, but existing tools don't allow for methods in multiple categories. If you fix that you get your multiple package membership in Monticello for free. Alternatively provide a UI to specify which other packages the method should be part of, and you're there, too.

Agreed.  But internally MC packages should specify an exact set of entities, and not rely on an extensional projection.  It is imprecise and hence inherently buggy. (I am being very anal today ;).

 


Cheers,
 - Andreas




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Stephen Pair
On Tue, Jun 30, 2009 at 3:00 PM, Eliot Miranda <[hidden email]> wrote:

 But as I've said earlier in the thread the extensional approach has problems when it comes to managing multiple packages that can overlap (as I think s inevitable in imperfect complex systems).  

I realize this thread is more concerned with the here and the now, but doesn't this problem go away entirely in a system like Newspeak?  When you can have modules of code co-resident and active at the same time, wouldn't you just create a new version of some package on which you depend rather than patch it with extension methods you define in your own package?  Your code would happily use your version of the package while others happily use the unmodified version.  I can see a potential need in cases where a body of code is designed to interface with some already present service (for example, a phone dialer application designed to use an AddressBook service).  But, in such a system, you wouldn't want to allow monkey patching anyway out of security concerns (if you could override the AddressBook interface, your code could potentially access information that the owner didn't want your code to access).

- Stephen 


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Eliot Miranda-2


On Tue, Jun 30, 2009 at 1:38 PM, Stephen Pair <[hidden email]> wrote:
On Tue, Jun 30, 2009 at 3:00 PM, Eliot Miranda <[hidden email]> wrote:

 But as I've said earlier in the thread the extensional approach has problems when it comes to managing multiple packages that can overlap (as I think s inevitable in imperfect complex systems).  

I realize this thread is more concerned with the here and the now, but doesn't this problem go away entirely in a system like Newspeak?  When you can have modules of code co-resident and active at the same time, wouldn't you just create a new version of some package on which you depend rather than patch it with extension methods you define in your own package?  Your code would happily use your version of the package while others happily use the unmodified version.

In theory yes.  But as soon as one had a living system which contained objects already active then I don't see how the Newspeak module system solves the problem.  It neatly allows one to reuse modules and extend them locally.  But as far as I can see once you want to interact in new ways with already live objects then one may still need to patch.

Gilad is virulently against monkey-patching and so there is no support for extensions in Newspeak modules; all very well.  But at the same time one of the models of use for Newspeak is where clients implemented in Newspeak are orthogonally synchronised (both data and code are updated) at suitable points in an applications' use (e.g. when a server interaction is initiated).  Here the author of a module is allowed to modify it and the next time any client containing an instance of that module would have the client's instance of the module updated transparently.  So in a situation where some rich application on the client is composed of two modules, and the author of one of them wants an extension method added to the other so that his modifications can function one would have to request the author of the other module to add it and (presumably) wait for changes to propagate.  There are lots of issues here (what if the author of the second module goes bust) but if the picture can be realised its actually much better than the Smalltalk package status quo because every instance is continuously integrated.  One of the issues that gives rise to the need for patches is that one can't ask the author to update their package and so one has to do it oneself.  Gilad's scheme is a great idea, but I'm not entirely sure it is that different from the current situation with automatically updated software (OSs etc).  As the software gets more complex so organizations are less able to change it frequently.  Newspeak may have some new means with which to attack the problem but the problem still remains.

 I can see a potential need in cases where a body of code is designed to interface with some already present service (for example, a phone dialer application designed to use an AddressBook service).  But, in such a system, you wouldn't want to allow monkey patching anyway out of security concerns (if you could override the AddressBook interface, your code could potentially access information that the owner didn't want your code to access).

But how do you override your own AddressBook?  Bringing a new one into existence is one thing, but modifying your fully-populated one implemented by someone else is another thing altogether.  If the system is so architected then it is presumably trivial to create a new instance, move the data across and replace the old with the new.  But if the system isn't (e.g. for security or ip concerns) then you can't.  But these issues operate at a higher level than the language/module/update level right?  The issues with monkey patching are to do with keeping software maintainable and comprehensible to software authors.  The issues of mutable extensible systems also involve their users, and that's more than I can think about right now :)

 

- Stephen 






Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Stephen Pair


On Tue, Jun 30, 2009 at 8:48 PM, Eliot Miranda <[hidden email]> wrote:
On Tue, Jun 30, 2009 at 1:38 PM, Stephen Pair <[hidden email]> wrote:

 I can see a potential need in cases where a body of code is designed to interface with some already present service (for example, a phone dialer application designed to use an AddressBook service).  But, in such a system, you wouldn't want to allow monkey patching anyway out of security concerns (if you could override the AddressBook interface, your code could potentially access information that the owner didn't want your code to access).

But how do you override your own AddressBook?  Bringing a new one into existence is one thing, but modifying your fully-populated one implemented by someone else is another thing altogether.  If the system is so architected then it is presumably trivial to create a new instance, move the data across and replace the old with the new.  But if the system isn't (e.g. for security or ip concerns) then you can't.  But these issues operate at a higher level than the language/module/update level right?  The issues with monkey patching are to do with keeping software maintainable and comprehensible to software authors.  The issues of mutable extensible systems also involve their users, and that's more than I can think about right now :)

Overriding your own AddressBook would be a problem of loading in new code and migrating the instances (pretty much like software works today where you load a new version of an application and it has to update your existing database(s)).  So, the new code would have whatever fancy new stuff you wanted to do in your AddressBook, but for external applications like the phone dialer to be able to interact with it, it would still need support some defined (and ideally versioned) interface.  To the degree that new versions of the phone dialer and the address book are backward compatible with the versions of the interface they support, you are free to upgrade each independently.  And, the AddressBook is free to use some highly customized collections framework while the phone dialer uses an entirely different implementation of collections.  Such a system would offer very significant benefits to a community like squeak.  Imagine being able to able to run squeak 2.0 and squeak 3.10 concurrently (with them able to communicate with each other) and imagine all the old, abandoned, but still useful projects that could be readily used without the need to migrate them to all the latest version of your favorite fork.  I don't see these issues as being at some higher level, I see the language and platform as lacking a much needed capability.

(btw, none of this necessarily implies everything must be in a single process, I imagine much of this could be accomplished using hydra for instance)

- Stephen


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Juan Vuletich-4
In reply to this post by Eliot Miranda-2
Eliot Miranda wrote:

>
> On Tue, Jun 30, 2009 at 11:37 AM, Andreas Raab <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     ...
>     I really fail to see how it would make any difference whatsoever
>     if extension methods are in multiple packages or not. In either
>     case you are *completely* screwed if you have multiple packages
>     trying to extend the same method. Seriously, has there ever been a
>     situation where that actually works? (my personal preference is
>     actually that MC should blow up straight into your face if you try
>     to change a method that's in an extension category already, but
>     that's just me - I generally avoid extensions like the plague)
>
>
> I don't avoid extensions, and personally feel extensions are a core
> part of building frameworks.  If objects are to interact they must
> provide protocol to support that interaction.  In adding a new
> framework to an existing system this means extending existing objects
> so that they can interact with the new framework.  Yes, one can do
> this badly, but there are lots of examples where this makes sense.
>
> As far as patching, we've had this conversation before.  I agree that
> a well-designed system will provide extension mechanisms that make
> patching unnecessary.

And later...

>
> Gilad is virulently against monkey-patching and so there is no support
> for extensions in Newspeak modules...

Extension methods are useful, but can be dangerous. Problems will arise
if a module modifies the behavior that is expected by the base system or
by other modules that do not include us as a prerequisite.

Things a module should not be able to do to existing classes (defined in
the base system or in other modules)
- patching: modify existing methods, including any extensions done by
other modules
- add new methods that redefine inherited behavior (I mean, a method not
already implemented but inherited)
- delete any method

Things a module should be able to do:
- extend existing classes with new methods that do not affect the base
system or any other module that does not include us as a prerequisite

An easy way to ensure this is to require each module to define a prefix
for its extension methods. The system must ensure that the prefixes are
distinct for all modules, and that a prefix can be used only by its
owning module to define new methods. The base system can not use any of
those prefixes. A module can call a prefixed method only if it owns it,
or it belongs to some other module that was declared as a prerequisite.

It is sort of cheap namespaces for methods (not for classes).

What do you think?

Cheers,
Juan Vuletich

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Stephen Pair


On Wed, Jul 1, 2009 at 9:08 AM, Juan Vuletich <[hidden email]> wrote:
Eliot Miranda wrote:

On Tue, Jun 30, 2009 at 11:37 AM, Andreas Raab <[hidden email] <mailto:[hidden email]>> wrote:

   ...

   I really fail to see how it would make any difference whatsoever
   if extension methods are in multiple packages or not. In either
   case you are *completely* screwed if you have multiple packages
   trying to extend the same method. Seriously, has there ever been a
   situation where that actually works? (my personal preference is
   actually that MC should blow up straight into your face if you try
   to change a method that's in an extension category already, but
   that's just me - I generally avoid extensions like the plague)


I don't avoid extensions, and personally feel extensions are a core part of building frameworks.  If objects are to interact they must provide protocol to support that interaction.  In adding a new framework to an existing system this means extending existing objects so that they can interact with the new framework.  Yes, one can do this badly, but there are lots of examples where this makes sense.

As far as patching, we've had this conversation before.  I agree that a well-designed system will provide extension mechanisms that make patching unnecessary.

And later...


Gilad is virulently against monkey-patching and so there is no support for extensions in Newspeak modules...

Extension methods are useful, but can be dangerous. Problems will arise if a module modifies the behavior that is expected by the base system or by other modules that do not include us as a prerequisite.

Things a module should not be able to do to existing classes (defined in the base system or in other modules)
- patching: modify existing methods, including any extensions done by other modules
- add new methods that redefine inherited behavior (I mean, a method not already implemented but inherited)
- delete any method

Things a module should be able to do:
- extend existing classes with new methods that do not affect the base system or any other module that does not include us as a prerequisite

An easy way to ensure this is to require each module to define a prefix for its extension methods. The system must ensure that the prefixes are distinct for all modules, and that a prefix can be used only by its owning module to define new methods. The base system can not use any of those prefixes. A module can call a prefixed method only if it owns it, or it belongs to some other module that was declared as a prerequisite.

It is sort of cheap namespaces for methods (not for classes).

What do you think?

Cheers,
Juan Vuletich


In the absence of a modular system like Newspeak, this is probably the best proposal.  It's probably even better than real selector namespaces, since I think a modular system like Newspeak makes even that irrelevant.  I once implemented real selector namespaces, modifying the compiler, updating the browsers (you could see multiple methods of the same name in the browser with the namespace to which each was affiliated in parens), etc.  It all worked and was even almost comprehensible, but I still was left with an icky feeling about it and abandoned the experiment.  I still think a modular system makes this problem go away and short of that, your proposal is probably the most practical.

- Stephen 


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Eliot Miranda-2
In reply to this post by Stephen Pair


On Tue, Jun 30, 2009 at 6:15 PM, Stephen Pair <[hidden email]> wrote:


On Tue, Jun 30, 2009 at 8:48 PM, Eliot Miranda <[hidden email]> wrote:
On Tue, Jun 30, 2009 at 1:38 PM, Stephen Pair <[hidden email]> wrote:

 I can see a potential need in cases where a body of code is designed to interface with some already present service (for example, a phone dialer application designed to use an AddressBook service).  But, in such a system, you wouldn't want to allow monkey patching anyway out of security concerns (if you could override the AddressBook interface, your code could potentially access information that the owner didn't want your code to access).

But how do you override your own AddressBook?  Bringing a new one into existence is one thing, but modifying your fully-populated one implemented by someone else is another thing altogether.  If the system is so architected then it is presumably trivial to create a new instance, move the data across and replace the old with the new.  But if the system isn't (e.g. for security or ip concerns) then you can't.  But these issues operate at a higher level than the language/module/update level right?  The issues with monkey patching are to do with keeping software maintainable and comprehensible to software authors.  The issues of mutable extensible systems also involve their users, and that's more than I can think about right now :)

Overriding your own AddressBook would be a problem of loading in new code and migrating the instances (pretty much like software works today where you load a new version of an application and it has to update your existing database(s)).

That's a fine scheme.  My point is that unless the system is so architected you can't necessarily do that.  Look at the iPhone for example; there are lots of restrictions on what a user can accomplish and there is software therein to detect attempts to hack around these restrictions and break things like software update when you try and update a hacked phone.  So your model only works in an architecture which supports it.  Since Newspeak doesn't encompass a complete device architecture it can't provide an update schema for it.  Expecting a language to address this is IMO a category error.  When one starts talking about for example a Smalltalk system running on bare hardware (e.g. Squeak NOS) then the system can encompass the entirety.  So we should first try and evolve Newspeak to NewspeakNOS and ten we can see how an evolved NewspeakNOS would address these update issues.
 
 So, the new code would have whatever fancy new stuff you wanted to do in your AddressBook, but for external applications like the phone dialer to be able to interact with it, it would still need support some defined (and ideally versioned) interface.  To the degree that new versions of the phone dialer and the address book are backward compatible with the versions of the interface they support, you are free to upgrade each independently.  And, the AddressBook is free to use some highly customized collections framework while the phone dialer uses an entirely different implementation of collections.  Such a system would offer very significant benefits to a community like squeak.  Imagine being able to able to run squeak 2.0 and squeak 3.10 concurrently (with them able to communicate with each other) and imagine all the old, abandoned, but still useful projects that could be readily used without the need to migrate them to all the latest version of your favorite fork.  I don't see these issues as being at some higher level, I see the language and platform as lacking a much needed capability.

(btw, none of this necessarily implies everything must be in a single process, I imagine much of this could be accomplished using hydra for instance)

- Stephen






Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Future of Squeak, and outsider's view

Stephen Pair


On Wed, Jul 1, 2009 at 12:18 PM, Eliot Miranda <[hidden email]> wrote:


On Tue, Jun 30, 2009 at 6:15 PM, Stephen Pair <[hidden email]> wrote:


On Tue, Jun 30, 2009 at 8:48 PM, Eliot Miranda <[hidden email]> wrote:
On Tue, Jun 30, 2009 at 1:38 PM, Stephen Pair <[hidden email]> wrote:

 I can see a potential need in cases where a body of code is designed to interface with some already present service (for example, a phone dialer application designed to use an AddressBook service).  But, in such a system, you wouldn't want to allow monkey patching anyway out of security concerns (if you could override the AddressBook interface, your code could potentially access information that the owner didn't want your code to access).

But how do you override your own AddressBook?  Bringing a new one into existence is one thing, but modifying your fully-populated one implemented by someone else is another thing altogether.  If the system is so architected then it is presumably trivial to create a new instance, move the data across and replace the old with the new.  But if the system isn't (e.g. for security or ip concerns) then you can't.  But these issues operate at a higher level than the language/module/update level right?  The issues with monkey patching are to do with keeping software maintainable and comprehensible to software authors.  The issues of mutable extensible systems also involve their users, and that's more than I can think about right now :)

Overriding your own AddressBook would be a problem of loading in new code and migrating the instances (pretty much like software works today where you load a new version of an application and it has to update your existing database(s)).

That's a fine scheme.  My point is that unless the system is so architected you can't necessarily do that.

LoL...well, of course...if the problem were already solved, there would be no point in contemplating possible solutions.
 
  Look at the iPhone for example; there are lots of restrictions on what a user can accomplish and there is software therein to detect attempts to hack around these restrictions and break things like software update when you try and update a hacked phone.  So your model only works in an architecture which supports it.  Since Newspeak doesn't encompass a complete device architecture it can't provide an update schema for it.  Expecting a language to address this is IMO a category error.  

Didn't someone once say that the operating system is where you resolve all of the inadequacies of your language (or something to that effect)?  ;)
 
When one starts talking about for example a Smalltalk system running on bare hardware (e.g. Squeak NOS) then the system can encompass the entirety.  So we should first try and evolve Newspeak to NewspeakNOS and ten we can see how an evolved NewspeakNOS would address these update issues.

I don't think you need to go to such lengths to either show that such a scheme would work, or to get use out of it if it does.  Regarding your iPhone example, it takes the discussion beyond the realm of that which we have control and into the realm of interfacing with legacy systems in which none of these kinds of issues have been considered or addressed.  Take and example of upgrading the AddressBook on the iPhone platform (where it's a third party tool over which you have no control other than to upgrade it) while having it still work with say a custom Dialer app that you wrote.  You are free to upgrade either of them independently so long as they both support a common interface.  If the interface were version controlled, you can deal with this problem in a pretty rational manner for an end user (when you go to the AppStore and try to upgrade the AddressBook app, it could alert you that "this new version of the AddressBook no longer supports version 1 of the AddressBook API and since we see that you have a registered dependency form some Dialer app on version 1.0, we can pretty much guarantee that it's going to break your Dialer app, are you sure you want to do this?"  You could then independently upgrade the Dialer app.

To bring this back to monkey patching...no, you cannot monkey patch the AddressBook API, but you can create a new version of some framework (with as many customizations as you desire) for use in your Dialer app while the, while the AddressBook continues to use some other version of that very same framework concurrently.  Of course, Cocoa is not going to support this kind of thing (at least not today), but it doesn't preclude apps in some other language that has Newspeak style modularization from doing this (regardless of whether it's running on bare metal or not).

I think I've run out of steam on this topic for now.

- Stephen



123