Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
October 2014
- 94 participants
- 1300 messages
Re: [Pharo-dev] CompiledMethod>>hash can produce clashes
by Max Leske
> On 17.10.2014, at 11:12, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>
> Exactly. So, the problem with Set is not in hash at all, but in equality. Of course, we can still enhance hash, but we should first focus on equality.
>
> And I am also of the opinion that equality should take the name of the selector and even the name of the class into account.
Did you read Eliotâs argument? He needs the equality definition to find duplicates.
I donât agree with you (anymore). The selector and the class are simply associated with a given CompiledMethod. But the CompiledMethod is still one without a name and without a class it is installed in. From that point of view, neither the class nor the selector should be included in the definition of equality.
I do agree however, that it kind of goes against the way programmers tend to think of methods, thus my idea (which I did not think through at all) to have something like CompiledMethodWrapper, that lets CompiledMethod be what it is and abstracts the object for use with class and selector (see my answer to Benâs e-mail).
Cheers,
Max
>
> Doru
>
> On Fri, Oct 17, 2014 at 9:52 AM, Max Leske <maxleske(a)gmail.com <mailto:maxleske@gmail.com>> wrote:
>
>> On 17.10.2014, at 09:37, Tudor Girba <tudor(a)tudorgirba.com <mailto:tudor@tudorgirba.com>> wrote:
>>
>> But why is Set being affected by hash? Hash is never guaranteed to be unique. Set should be affected by equality.
>
> Well, actually itâs both #hash and #=. First the set tries to find a suitable place for the element using the elements hash. If that place is already taken it then checks equality. Since the equality definition is mostly the same (same literals, same byte codes etc.), the second element is rejected because itâs already in the set.
>
>>
>> Doru
>>
>> On Fri, Oct 17, 2014 at 9:34 AM, Max Leske <maxleske(a)gmail.com <mailto:maxleske@gmail.com>> wrote:
>>
>>> On 17.10.2014, at 02:46, Ben Coman <btc(a)openInWorld.com <mailto:btc@openInWorld.com>> wrote:
>>>
>>> Richard Sargent wrote:
>>>> Eliot Miranda-2 wrote
>>>>> On Wed, Oct 15, 2014 at 10:50 AM, Richard Sargent <
>>>>> richard.sargent@
>>>>>> wrote:
>>>>>> One of the best things about Smalltalk is how easily we can say what we
>>>>>> mean. I think you would be better off creating a method named something
>>>>>> like
>>>>>> #hasSameEffectAs: to answer what you are presently using #= to do, and
>>>>>> change #= to answer the, in my opinion, more sensible "is the same as"
>>>>>> that
>>>>>> we conventionally think of #= meaning.
>>>>>>
>>>>> But that's the point. #= has to mean something and having it mean #==
>>>>> isn't useful, so one has to choose some value-based semantic for
>>>>> CompiledMethod>>#= and the one that's there is useful. Defining what #=
>>>>> means for some value type is far easier than defining what it might mean
>>>>> for something as complex as a CompiledMethod. The definition in
>>>>> Squeak/Pharo has been useful to me in implementing a closure-based system,
>>>>> so I'm unapologetic about the current definition. It is a good one but it
>>>>> doesn't preclude defining others.
>>>> An interesting response. You ignored the point that e.g. #hasSameEffectAs:
>>>> provides greater clarity and add an argument against something I didn't say.
>>>> I also don't think defining equality for a CompiledMethod is particularly
>>>> difficult. If I were to recompile a method's source code, I would get a new
>>>> instance of a CompiledMethod that would, in my opinion, be equal to the one
>>>> already installed in the class (and perhaps cached in the VM's
>>>> optimizations). So one would be able to say that we would not replace an
>>>> existing CompiledMethod with an equal one. The current implementation of #=
>>>> has no such characteristic, since it proclaims a CompiledMethod named #a to
>>>> be equal to one named #z.
>>>
>>> @Richard
>>>
>>> That doesn't seem to be a good example for what your trying to say.
>>> Given...
>>>
>>> [1] SomeClass>>a "original instance"
>>> ^1
>>>
>>> [2] SomeClass>>a "recompiled instance"
>>> ^1
>>>
>>> [3] SomeClass>>z
>>> ^1
>>>
>>> ...you seem to be saying that its useful to know if [1]=[2],
>>> but imply that is invalidated by [2]=[3] ?
>>>
>>> But [1]=[2] remains true, and just as useful for your example.
>>>
>>>
>>> @Max
>>>
>>> I guess to call it a bug, you bumped into a different use case
>>> where [2]=[3] is problematic. Can you describe that?
>>
>> Well, not problematic. Once you accept that neither selector nor class are part of a CompiledMethod it is obvious that two instances with the same byte codes produce the same hash.
>>
>> The actual problem is more one of understanding and use. The following code answers a collection with the CompiledMethods Collection>>add:, Collection>>do: and Collection>>remove:ifAbsent:
>>
>> Collection methods select: #isAbstract.
>>
>> All three CompiledMethods are implemented as â^ self subclassResponsibilityâ, so they have the same byte codes. Now, if you take that collection and make a set out of it youâll lose Collection>>do: since #do: and #add: produce the same hash, but #remove:ifAbsent: doesnât because the number of arguments is calculated into the hash (actually the CompiledMethod header is).
>>
>> So, as long as you think of CompiledMethods as objects that have a name, it looks like a bug and in my opinion this behaviour is something that messes with the mind of newcomers. Just a (silly) idea: something like a CompiledMethodWrapper might solve the problem (at least from the user perspective; everything is slightly different from the VM perspective :) ), as it could hold on to the class and the selector independently of the actual CompiledMethod.
>>
>> In the end however, one doesnât work with compiled methods a lot and the hash situation is unlikely to cause a lot of problems (people working with CompiledMethod usually know what they are doing).
>>
>> Cheers,
>> Max
>>
>>>
>>>
>>> cheers -ben
>>>
>>>
>>>> The blue book say #= means "Answer whether the receiver and the argument
>>>> represent the same component." The current implementation does so only for
>>>> some, in my opinion, counter-intuitive definition of "same component".
>>>> --
>>>> View this message in context: http://forum.world.st/CompiledMethod-hash-can-produce-clashes-tp4784722p478… <http://forum.world.st/CompiledMethod-hash-can-produce-clashes-tp4784722p478…>
>>>> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com <http://nabble.com/>.
>>
>>
>>
>>
>> --
>> www.tudorgirba.com <http://www.tudorgirba.com/>
>>
>> "Every thing has its own flow"
>
>
>
>
> --
> www.tudorgirba.com <http://www.tudorgirba.com/>
>
> "Every thing has its own flow"
Oct. 17, 2014
Re: [Pharo-dev] CompiledMethod>>hash can produce clashes
by Sven Van Caekenberghe
On 17 Oct 2014, at 11:12, Tudor Girba <tudor(a)tudorgirba.com> wrote:
> Exactly. So, the problem with Set is not in hash at all, but in equality. Of course, we can still enhance hash, but we should first focus on equality.
>
> And I am also of the opinion that equality should take the name of the selector and even the name of the class into account.
>From a modelling standpoint it sounds as if one object (CompiledMethod) is used for two different things which results in the conflicting ideas about implementing equality and hashing. A CompiledMethod should hold a CompiledCode object while adding the selector and class. The CompiledCode object could then be equivalent or even be optionally shared among similar methods (like all those implementing ^self).
Just an external observation / idea.
> Doru
>
> On Fri, Oct 17, 2014 at 9:52 AM, Max Leske <maxleske(a)gmail.com> wrote:
>
>> On 17.10.2014, at 09:37, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>>
>> But why is Set being affected by hash? Hash is never guaranteed to be unique. Set should be affected by equality.
>
> Well, actually itâs both #hash and #=. First the set tries to find a suitable place for the element using the elements hash. If that place is already taken it then checks equality. Since the equality definition is mostly the same (same literals, same byte codes etc.), the second element is rejected because itâs already in the set.
>
>>
>> Doru
>>
>> On Fri, Oct 17, 2014 at 9:34 AM, Max Leske <maxleske(a)gmail.com> wrote:
>>
>>> On 17.10.2014, at 02:46, Ben Coman <btc(a)openInWorld.com> wrote:
>>>
>>> Richard Sargent wrote:
>>>> Eliot Miranda-2 wrote
>>>>> On Wed, Oct 15, 2014 at 10:50 AM, Richard Sargent <
>>>>> richard.sargent@
>>>>>> wrote:
>>>>>> One of the best things about Smalltalk is how easily we can say what we
>>>>>> mean. I think you would be better off creating a method named something
>>>>>> like
>>>>>> #hasSameEffectAs: to answer what you are presently using #= to do, and
>>>>>> change #= to answer the, in my opinion, more sensible "is the same as"
>>>>>> that
>>>>>> we conventionally think of #= meaning.
>>>>>>
>>>>> But that's the point. #= has to mean something and having it mean #==
>>>>> isn't useful, so one has to choose some value-based semantic for
>>>>> CompiledMethod>>#= and the one that's there is useful. Defining what #=
>>>>> means for some value type is far easier than defining what it might mean
>>>>> for something as complex as a CompiledMethod. The definition in
>>>>> Squeak/Pharo has been useful to me in implementing a closure-based system,
>>>>> so I'm unapologetic about the current definition. It is a good one but it
>>>>> doesn't preclude defining others.
>>>> An interesting response. You ignored the point that e.g. #hasSameEffectAs:
>>>> provides greater clarity and add an argument against something I didn't say.
>>>> I also don't think defining equality for a CompiledMethod is particularly
>>>> difficult. If I were to recompile a method's source code, I would get a new
>>>> instance of a CompiledMethod that would, in my opinion, be equal to the one
>>>> already installed in the class (and perhaps cached in the VM's
>>>> optimizations). So one would be able to say that we would not replace an
>>>> existing CompiledMethod with an equal one. The current implementation of #=
>>>> has no such characteristic, since it proclaims a CompiledMethod named #a to
>>>> be equal to one named #z.
>>>
>>> @Richard
>>>
>>> That doesn't seem to be a good example for what your trying to say.
>>> Given...
>>>
>>> [1] SomeClass>>a "original instance"
>>> ^1
>>>
>>> [2] SomeClass>>a "recompiled instance"
>>> ^1
>>>
>>> [3] SomeClass>>z
>>> ^1
>>>
>>> ...you seem to be saying that its useful to know if [1]=[2],
>>> but imply that is invalidated by [2]=[3] ?
>>>
>>> But [1]=[2] remains true, and just as useful for your example.
>>>
>>>
>>> @Max
>>>
>>> I guess to call it a bug, you bumped into a different use case
>>> where [2]=[3] is problematic. Can you describe that?
>>
>> Well, not problematic. Once you accept that neither selector nor class are part of a CompiledMethod it is obvious that two instances with the same byte codes produce the same hash.
>>
>> The actual problem is more one of understanding and use. The following code answers a collection with the CompiledMethods Collection>>add:, Collection>>do: and Collection>>remove:ifAbsent:
>>
>> Collection methods select: #isAbstract.
>>
>> All three CompiledMethods are implemented as â^ self subclassResponsibilityâ, so they have the same byte codes. Now, if you take that collection and make a set out of it youâll lose Collection>>do: since #do: and #add: produce the same hash, but #remove:ifAbsent: doesnât because the number of arguments is calculated into the hash (actually the CompiledMethod header is).
>>
>> So, as long as you think of CompiledMethods as objects that have a name, it looks like a bug and in my opinion this behaviour is something that messes with the mind of newcomers. Just a (silly) idea: something like a CompiledMethodWrapper might solve the problem (at least from the user perspective; everything is slightly different from the VM perspective :) ), as it could hold on to the class and the selector independently of the actual CompiledMethod.
>>
>> In the end however, one doesnât work with compiled methods a lot and the hash situation is unlikely to cause a lot of problems (people working with CompiledMethod usually know what they are doing).
>>
>> Cheers,
>> Max
>>
>>>
>>>
>>> cheers -ben
>>>
>>>
>>>> The blue book say #= means "Answer whether the receiver and the argument
>>>> represent the same component." The current implementation does so only for
>>>> some, in my opinion, counter-intuitive definition of "same component".
>>>> --
>>>> View this message in context: http://forum.world.st/CompiledMethod-hash-can-produce-clashes-tp4784722p478…
>>>> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>>
>>
>>
>>
>> --
>> www.tudorgirba.com
>>
>> "Every thing has its own flow"
>
>
>
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
Oct. 17, 2014
Re: [Pharo-dev] CompiledMethod>>hash can produce clashes
by Tudor Girba
Exactly. So, the problem with Set is not in hash at all, but in equality.
Of course, we can still enhance hash, but we should first focus on equality.
And I am also of the opinion that equality should take the name of the
selector and even the name of the class into account.
Doru
On Fri, Oct 17, 2014 at 9:52 AM, Max Leske <maxleske(a)gmail.com> wrote:
>
> On 17.10.2014, at 09:37, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>
> But why is Set being affected by hash? Hash is never guaranteed to be
> unique. Set should be affected by equality.
>
>
> Well, actually itâs both #hash and #=. First the set tries to find a
> suitable place for the element using the elements hash. If that place is
> already taken it then checks equality. Since the equality definition is
> mostly the same (same literals, same byte codes etc.), the second element
> is rejected because itâs already in the set.
>
>
> Doru
>
> On Fri, Oct 17, 2014 at 9:34 AM, Max Leske <maxleske(a)gmail.com> wrote:
>
>>
>> On 17.10.2014, at 02:46, Ben Coman <btc(a)openInWorld.com> wrote:
>>
>> Richard Sargent wrote:
>>
>> Eliot Miranda-2 wrote
>>
>> On Wed, Oct 15, 2014 at 10:50 AM, Richard Sargent <
>>
>> richard.sargent@
>>
>> wrote:
>> One of the best things about Smalltalk is how easily we can say what we
>> mean. I think you would be better off creating a method named something
>> like
>> #hasSameEffectAs: to answer what you are presently using #= to do, and
>> change #= to answer the, in my opinion, more sensible "is the same as"
>> that
>> we conventionally think of #= meaning.
>>
>> But that's the point. #= has to mean something and having it mean #==
>> isn't useful, so one has to choose some value-based semantic for
>> CompiledMethod>>#= and the one that's there is useful. Defining what #=
>> means for some value type is far easier than defining what it might mean
>> for something as complex as a CompiledMethod. The definition in
>> Squeak/Pharo has been useful to me in implementing a closure-based system,
>> so I'm unapologetic about the current definition. It is a good one but it
>> doesn't preclude defining others.
>>
>> An interesting response. You ignored the point that e.g. #hasSameEffectAs:
>> provides greater clarity and add an argument against something I didn't
>> say.
>> I also don't think defining equality for a CompiledMethod is particularly
>> difficult. If I were to recompile a method's source code, I would get a
>> new
>> instance of a CompiledMethod that would, in my opinion, be equal to the
>> one
>> already installed in the class (and perhaps cached in the VM's
>> optimizations). So one would be able to say that we would not replace an
>> existing CompiledMethod with an equal one. The current implementation of
>> #=
>> has no such characteristic, since it proclaims a CompiledMethod named #a
>> to
>> be equal to one named #z.
>>
>>
>> @Richard
>>
>> That doesn't seem to be a good example for what your trying to say.
>> Given...
>>
>> [1] SomeClass>>a "original instance"
>> ^1
>>
>> [2] SomeClass>>a "recompiled instance"
>> ^1
>>
>> [3] SomeClass>>z
>> ^1
>>
>> ...you seem to be saying that its useful to know if [1]=[2],
>> but imply that is invalidated by [2]=[3] ?
>>
>> But [1]=[2] remains true, and just as useful for your example.
>>
>>
>> @Max
>>
>> I guess to call it a bug, you bumped into a different use case
>> where [2]=[3] is problematic. Can you describe that?
>>
>>
>> Well, not problematic. Once you accept that neither selector nor class
>> are part of a CompiledMethod it is obvious that two instances with the same
>> byte codes produce the same hash.
>>
>> The actual problem is more one of understanding and use. The following
>> code answers a collection with the CompiledMethods Collection>>add:,
>> Collection>>do: and Collection>>remove:ifAbsent:
>>
>> Collection methods select: #isAbstract.
>>
>>
>> All three CompiledMethods are implemented as â^ self
>> subclassResponsibilityâ, so they have the same byte codes. Now, if you take
>> that collection and make a set out of it youâll lose Collection>>do: since
>> #do: and #add: produce the same hash, but #remove:ifAbsent: doesnât because
>> the number of arguments is calculated into the hash (actually the
>> CompiledMethod header is).
>>
>> So, as long as you think of CompiledMethods as objects that have a name,
>> it looks like a bug and in my opinion this behaviour is something that
>> messes with the mind of newcomers. Just a (silly) idea: something like a
>> CompiledMethodWrapper might solve the problem (at least from the user
>> perspective; everything is slightly different from the VM perspective :) ),
>> as it could hold on to the class and the selector independently of the
>> actual CompiledMethod.
>>
>> In the end however, one doesnât work with compiled methods a lot and the
>> hash situation is unlikely to cause a lot of problems (people working with
>> CompiledMethod usually know what they are doing).
>>
>> Cheers,
>> Max
>>
>>
>>
>> cheers -ben
>>
>>
>> The blue book say #= means "Answer whether the receiver and the argument
>> represent the same component." The current implementation does so only for
>> some, in my opinion, counter-intuitive definition of "same component".
>> --
>> View this message in context:
>> http://forum.world.st/CompiledMethod-hash-can-produce-clashes-tp4784722p478…
>> Sent from the Pharo Smalltalk Developers mailing list archive at
>> Nabble.com <http://nabble.com/>.
>>
>>
>>
>
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
>
>
>
--
www.tudorgirba.com
"Every thing has its own flow"
Oct. 17, 2014
Re: [Pharo-dev] PharoNOS
by Torsten Bergmann
Hi Mike,
tried to swap the image using the following procedure:
1. Run the following code to download latest Pharo 4.0
ZnClient new
url: 'http://files.pharo.org/image/40/latest.zip';
downloadTo: '/mnt/universe/pharo-image/latest.zip'.
ZipArchive extractAllIn: '/mnt/universe/pharo-image/latest.zip'.
and extract to "/mnt/universe/pharo-image/"
2. Now I wanted to change /mnt/universe/image file name
to point to the new image. Unfortunately I can not write or delete/recreate
this file from Pharo's file browser.
Can you provide the build script for the ISO also on GitHub?
Thx
T.
Oct. 17, 2014
Re: [Pharo-dev] OrderedDictionary and new tools, Seaside...
by Sven Van Caekenberghe
On 16 Oct 2014, at 15:01, Marcus Denker <marcus.denker(a)inria.fr> wrote:
>>
>> On 16 Oct 2014, at 14:55, phil(a)highoctane.be wrote:
>>
>> I am using OrderedDictionary in quite a few places.
>>
>> Now, I have to steam a lot of extra methods from Dictionary as the GTInspector doesn't display things properly, nor the WAInspector and its subclasses out of the box.
>> NeoJSON same story, as Ston etc.
>>
>> OrderPreservingDictionary is quite useful.
>> Yes, there is GRSmallDictionary but it also has the same issues.
>>
>> OrderPreservingDictionary is at least a Collection where GRSmallDictionary is a GRObject.
>>
>> What would be the best strategy here?
>>
>> We need such an ordered map all the time, it deserves a bit better.
>>
>> Opinions?
>>
>
> In Pharo4, I copied OrderPreservingDictionary to OrderedDictionary.
> (to have a default one in the image without disturbing clients of OrderPreservingDictionary)
>
> This should be improved if it something is missing.
>
> Marcus
https://pharo.fogbugz.com/f/cases/14260/Add-gt-inspector-views-to-Ordered-I…
Oct. 17, 2014
Re: [Pharo-dev] PharoNOS
by Rafael Luque
Then, PharoNOS does not mean No Operating System, but minimun operating
system?
A few days ago I answered in this list about Smalltalk-based unikernels,
similar to Mirage OS (http://www.openmirage.org/)
Do you think PharoNOS can evolve into this kind of tool?
2014-10-17 10:28 GMT+02:00 kilon alios <kilon.alios(a)gmail.com>:
> I see, I dont have experience with TinyCore linux, but I do have
> experience with puppy linux which I really liked and used several times on
> my older pcs. Interest concept , good work :)
>
> Actually puppy linux is similar to what you do, in the sense that it uses
> its own programming language , genie
>
>
> https://wiki.gnome.org/action/show/Projects/Genie?action=show&redirect=Genie
>
> On Fri, Oct 17, 2014 at 10:59 AM, mikefilonov <mikefilonov(a)gmail.com>
> wrote:
>
>> Yes, the idea of PharoNOS is to have the Smalltalk-only environment with
>> as
>> little external stuff as possible.
>>
>> Current PharoNOS implementation based on TinyCore Linux - the smallest
>> Linux
>> distro - in order to have the smallest possible system footprint.
>>
>> >Why not just download a small linux distro and install Pharo ?
>>
>> Well, basically this what PharoNOS is :)
>>
>>
>>
>> --
>> View this message in context:
>> http://forum.world.st/PharoNOS-tp4784982p4785089.html
>> Sent from the Pharo Smalltalk Developers mailing list archive at
>> Nabble.com.
>>
>>
>
Oct. 17, 2014
Re: [Pharo-dev] PharoNOS
by kilon alios
I see, I dont have experience with TinyCore linux, but I do have experience
with puppy linux which I really liked and used several times on my older
pcs. Interest concept , good work :)
Actually puppy linux is similar to what you do, in the sense that it uses
its own programming language , genie
https://wiki.gnome.org/action/show/Projects/Genie?action=show&redirect=Genie
On Fri, Oct 17, 2014 at 10:59 AM, mikefilonov <mikefilonov(a)gmail.com> wrote:
> Yes, the idea of PharoNOS is to have the Smalltalk-only environment with as
> little external stuff as possible.
>
> Current PharoNOS implementation based on TinyCore Linux - the smallest
> Linux
> distro - in order to have the smallest possible system footprint.
>
> >Why not just download a small linux distro and install Pharo ?
>
> Well, basically this what PharoNOS is :)
>
>
>
> --
> View this message in context:
> http://forum.world.st/PharoNOS-tp4784982p4785089.html
> Sent from the Pharo Smalltalk Developers mailing list archive at
> Nabble.com.
>
>
Oct. 17, 2014
Re: [Pharo-dev] PharoNOS
by mikefilonov
Yes, the idea of PharoNOS is to have the Smalltalk-only environment with as
little external stuff as possible.
Current PharoNOS implementation based on TinyCore Linux - the smallest Linux
distro - in order to have the smallest possible system footprint.
>Why not just download a small linux distro and install Pharo ?
Well, basically this what PharoNOS is :)
--
View this message in context: http://forum.world.st/PharoNOS-tp4784982p4785089.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Oct. 17, 2014
Re: [Pharo-dev] PharoNOS
by Damien Cassou
On Fri, Oct 17, 2014 at 3:47 AM, mikefilonov <mikefilonov(a)gmail.com> wrote:
> Hm, just now get the idea to run Image chooser if
> default image failed. Is it available on linux?
>
you have the pharo launcher that let's you download images from the web (be
it on jenkins, on files.pharo.org, or on your own server)
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing
enthusiasm."
Winston Churchill
Oct. 17, 2014
Re: [Pharo-dev] CompiledMethod>>hash can produce clashes
by Max Leske
> On 17.10.2014, at 09:37, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>
> But why is Set being affected by hash? Hash is never guaranteed to be unique. Set should be affected by equality.
Well, actually itâs both #hash and #=. First the set tries to find a suitable place for the element using the elements hash. If that place is already taken it then checks equality. Since the equality definition is mostly the same (same literals, same byte codes etc.), the second element is rejected because itâs already in the set.
>
> Doru
>
> On Fri, Oct 17, 2014 at 9:34 AM, Max Leske <maxleske(a)gmail.com <mailto:maxleske@gmail.com>> wrote:
>
>> On 17.10.2014, at 02:46, Ben Coman <btc(a)openInWorld.com <mailto:btc@openInWorld.com>> wrote:
>>
>> Richard Sargent wrote:
>>> Eliot Miranda-2 wrote
>>>> On Wed, Oct 15, 2014 at 10:50 AM, Richard Sargent <
>>>> richard.sargent@
>>>>> wrote:
>>>>> One of the best things about Smalltalk is how easily we can say what we
>>>>> mean. I think you would be better off creating a method named something
>>>>> like
>>>>> #hasSameEffectAs: to answer what you are presently using #= to do, and
>>>>> change #= to answer the, in my opinion, more sensible "is the same as"
>>>>> that
>>>>> we conventionally think of #= meaning.
>>>>>
>>>> But that's the point. #= has to mean something and having it mean #==
>>>> isn't useful, so one has to choose some value-based semantic for
>>>> CompiledMethod>>#= and the one that's there is useful. Defining what #=
>>>> means for some value type is far easier than defining what it might mean
>>>> for something as complex as a CompiledMethod. The definition in
>>>> Squeak/Pharo has been useful to me in implementing a closure-based system,
>>>> so I'm unapologetic about the current definition. It is a good one but it
>>>> doesn't preclude defining others.
>>> An interesting response. You ignored the point that e.g. #hasSameEffectAs:
>>> provides greater clarity and add an argument against something I didn't say.
>>> I also don't think defining equality for a CompiledMethod is particularly
>>> difficult. If I were to recompile a method's source code, I would get a new
>>> instance of a CompiledMethod that would, in my opinion, be equal to the one
>>> already installed in the class (and perhaps cached in the VM's
>>> optimizations). So one would be able to say that we would not replace an
>>> existing CompiledMethod with an equal one. The current implementation of #=
>>> has no such characteristic, since it proclaims a CompiledMethod named #a to
>>> be equal to one named #z.
>>
>> @Richard
>>
>> That doesn't seem to be a good example for what your trying to say.
>> Given...
>>
>> [1] SomeClass>>a "original instance"
>> ^1
>>
>> [2] SomeClass>>a "recompiled instance"
>> ^1
>>
>> [3] SomeClass>>z
>> ^1
>>
>> ...you seem to be saying that its useful to know if [1]=[2],
>> but imply that is invalidated by [2]=[3] ?
>>
>> But [1]=[2] remains true, and just as useful for your example.
>>
>>
>> @Max
>>
>> I guess to call it a bug, you bumped into a different use case
>> where [2]=[3] is problematic. Can you describe that?
>
> Well, not problematic. Once you accept that neither selector nor class are part of a CompiledMethod it is obvious that two instances with the same byte codes produce the same hash.
>
> The actual problem is more one of understanding and use. The following code answers a collection with the CompiledMethods Collection>>add:, Collection>>do: and Collection>>remove:ifAbsent:
>
> Collection methods select: #isAbstract.
>
> All three CompiledMethods are implemented as â^ self subclassResponsibilityâ, so they have the same byte codes. Now, if you take that collection and make a set out of it youâll lose Collection>>do: since #do: and #add: produce the same hash, but #remove:ifAbsent: doesnât because the number of arguments is calculated into the hash (actually the CompiledMethod header is).
>
> So, as long as you think of CompiledMethods as objects that have a name, it looks like a bug and in my opinion this behaviour is something that messes with the mind of newcomers. Just a (silly) idea: something like a CompiledMethodWrapper might solve the problem (at least from the user perspective; everything is slightly different from the VM perspective :) ), as it could hold on to the class and the selector independently of the actual CompiledMethod.
>
> In the end however, one doesnât work with compiled methods a lot and the hash situation is unlikely to cause a lot of problems (people working with CompiledMethod usually know what they are doing).
>
> Cheers,
> Max
>
>>
>>
>> cheers -ben
>>
>>
>>> The blue book say #= means "Answer whether the receiver and the argument
>>> represent the same component." The current implementation does so only for
>>> some, in my opinion, counter-intuitive definition of "same component".
>>> --
>>> View this message in context: http://forum.world.st/CompiledMethod-hash-can-produce-clashes-tp4784722p478… <http://forum.world.st/CompiledMethod-hash-can-produce-clashes-tp4784722p478…>
>>> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com <http://nabble.com/>.
>
>
>
>
> --
> www.tudorgirba.com <http://www.tudorgirba.com/>
>
> "Every thing has its own flow"
Oct. 17, 2014