Discussion:
loose methods: Smalltalk asPython
(too old to reply)
Jan Theodore Galkowski
2006-12-27 21:22:54 UTC
Permalink
Guido was opposed to modifying builtin types before Java existed. It's
similar to his opposition to dynamic syntax.
Opposition or not, the language definition is there. Surely Smalltalk's
OO style can be respected. Smalltalkers have been doing OO in a dynamic
context longer than many. There are things to learn there.

There are two things here that need to be kept straight, I think.

One is the primacy of builtin types.

The other is placing those builtins at the top of their own object
hierarchy. Is "int", properly speaking, a descendent of "object"? No,
it's the root of its own tree. Smalltalk has "int" as well, as a
*subclass* of Number. It's primitive.

In any case, as respectful of Mr/Dr van Rossum as I am, simply because
so-and-so says something is bad and therefore it must be true is a
fallacious response.

-- Jan
Jan Theodore Galkowski
2006-12-27 16:56:40 UTC
Permalink
Comments? Suggestions?
<http://www.ruby-lang.org>
Luc, don't misunderstand: There's nothing at all wrong with Python nor
am I suggesting there is. I'm just exploring how far I can go using its
dynamic nature. There's no hope of using loose methods in Java.

I think Python is very fine although, arguably, because many are
approaching it from a Java strong-typing static mindset, I bet the space
of design possibilities hasn't been explored thoroughly. We've not had
an excellent dynamic OO language since Smalltalk, IMO. Perhaps Ruby is
or is not. But I've looked a bit at Ruby, and I like Python more.

- Jan
Aahz
2006-12-27 17:58:55 UTC
Permalink
In article <mailman.2052.1167238665.32031.python-list at python.org>,
Post by Jan Theodore Galkowski
I think Python is very fine although, arguably, because many are
approaching it from a Java strong-typing static mindset, I bet the space
of design possibilities hasn't been explored thoroughly. We've not had
an excellent dynamic OO language since Smalltalk, IMO. Perhaps Ruby is
or is not. But I've looked a bit at Ruby, and I like Python more.
Guido was opposed to modifying builtin types before Java existed. It's
similar to his opposition to dynamic syntax.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/

"I support family values -- Addams family values" --www.nancybuttons.com
Marc 'BlackJack' Rintsch
2006-12-27 22:40:49 UTC
Permalink
In <mailman.2058.1167254642.32031.python-list at python.org>, Jan Theodore
Post by Jan Theodore Galkowski
Guido was opposed to modifying builtin types before Java existed. It's
similar to his opposition to dynamic syntax.
The other is placing those builtins at the top of their own object
hierarchy. Is "int", properly speaking, a descendent of "object"?
In [108]: issubclass(int, object)
Out[108]: True
Post by Jan Theodore Galkowski
In any case, as respectful of Mr/Dr van Rossum as I am, simply because
so-and-so says something is bad and therefore it must be true is a
fallacious response.
I don't think the response was meant to say that it must be bad but that
it won't show up as feature in Python as long as the BDFL thinks it's bad.

Ciao,
Marc 'BlackJack' Rintsch
Jan Theodore Galkowski
2006-12-28 03:22:23 UTC
Permalink
This post might be inappropriate. Click to display it.
Carl Banks
2006-12-27 23:01:32 UTC
Permalink
Post by Jan Theodore Galkowski
Post by Jan Theodore Galkowski
We've not had
an excellent dynamic OO language since Smalltalk, IMO.
I would say that "excellence" in object oriented programming is not a
strong design goal of Python. Python tries to support OOP well, but
not to enhance OOP to the detriment of other, more important goals.

[snip]
Post by Jan Theodore Galkowski
Post by Jan Theodore Galkowski
Guido was opposed to modifying builtin types before Java existed. It's
similar to his opposition to dynamic syntax.
Opposition or not, the language definition is there. Surely Smalltalk's
OO style can be respected. Smalltalkers have been doing OO in a dynamic
context longer than many. There are things to learn there.
Well, that Smalltalk and Ruby do this at least suggests that it won't
be the end of the world as we know it if it were to happen in Python.
Personally, I'm with Guido here. Allowing this might make Python's OOP
more "excellent", but it would be to the detriment of other, more
important goals, like minimizing surprise.
Post by Jan Theodore Galkowski
There are two things here that need to be kept straight, I think.
One is the primacy of builtin types.
The other is placing those builtins at the top of their own object
hierarchy. Is "int", properly speaking, a descendent of "object"? No,
it's the root of its own tree.
Are you saying that it shouldn't be a descendant of "object", or that
it isn't? "int" is certainly a subclass of "object" in Python (as are
all objects).
Post by Jan Theodore Galkowski
Smalltalk has "int" as well, as a
*subclass* of Number. It's primitive.
Number is primitive? I thought all types in Smalltalk had a common
base type.

Anyways, Python 3000 is exploring the idea of an abstract hierarchy
that has classes (interfaces?) like Number and Sequence. In fact, I
even saw some talk about somehow being able to retrofit classes to
support one of these interfaces/ABCs, though it was pretty conjectural.
Post by Jan Theodore Galkowski
In any case, as respectful of Mr/Dr van Rossum as I am, simply because
so-and-so says something is bad and therefore it must be true is a
fallacious response.
The same could be said of Smalltalk, i.e., because Smalltalk does it
therefore it is good is just as fallacious.

Regardless, whatever Guido pronounces is what happens. If he's
adamantly against something, it's pretty much an academic discussion.


Carl Banks
Steve Holden
2007-01-26 15:53:25 UTC
Permalink
Post by Carl Banks
Post by Jan Theodore Galkowski
Post by Jan Theodore Galkowski
We've not had
an excellent dynamic OO language since Smalltalk, IMO.
I would say that "excellence" in object oriented programming is not a
strong design goal of Python. Python tries to support OOP well, but
not to enhance OOP to the detriment of other, more important goals.
[snip]
Post by Jan Theodore Galkowski
Post by Jan Theodore Galkowski
Guido was opposed to modifying builtin types before Java existed. It's
similar to his opposition to dynamic syntax.
Opposition or not, the language definition is there. Surely Smalltalk's
OO style can be respected. Smalltalkers have been doing OO in a dynamic
context longer than many. There are things to learn there.
Well, that Smalltalk and Ruby do this at least suggests that it won't
be the end of the world as we know it if it were to happen in Python.
Personally, I'm with Guido here. Allowing this might make Python's OOP
more "excellent", but it would be to the detriment of other, more
important goals, like minimizing surprise.
Post by Jan Theodore Galkowski
There are two things here that need to be kept straight, I think.
One is the primacy of builtin types.
The other is placing those builtins at the top of their own object
hierarchy. Is "int", properly speaking, a descendent of "object"? No,
it's the root of its own tree.
Are you saying that it shouldn't be a descendant of "object", or that
it isn't? "int" is certainly a subclass of "object" in Python (as are
all objects).
Post by Jan Theodore Galkowski
Smalltalk has "int" as well, as a
*subclass* of Number. It's primitive.
Number is primitive? I thought all types in Smalltalk had a common
base type.
Anyways, Python 3000 is exploring the idea of an abstract hierarchy
that has classes (interfaces?) like Number and Sequence. In fact, I
even saw some talk about somehow being able to retrofit classes to
support one of these interfaces/ABCs, though it was pretty conjectural.
Post by Jan Theodore Galkowski
In any case, as respectful of Mr/Dr van Rossum as I am, simply because
so-and-so says something is bad and therefore it must be true is a
fallacious response.
The same could be said of Smalltalk, i.e., because Smalltalk does it
therefore it is good is just as fallacious.
Regardless, whatever Guido pronounces is what happens. If he's
adamantly against something, it's pretty much an academic discussion.
Just to be perverse, there was an example recently where a developer
asked (on python-dev) about the best way to trap and note the creation
of all objects.

With a proper hierarchy, in which everything calls its parent's
constructor all the way up to object, in theory (and ignoring old-style
classes) it would be possible to simply modify the behaviour of object.
Unfortunately this is a no-no because object's behaviour is hard-wired
into the CPython interpreter.

The general feeling on python-dev seems to be that this is a step too
far, and that the confusion engendered by this kind of patching would
not be worth the benefits gained. Certainly it appears to this reader
that such a feature woudl be more abused than used.

The principle of least surprise thus reigns for now.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
Blog of Note: http://holdenweb.blogspot.com
Jan Theodore Galkowski
2006-12-28 04:48:46 UTC
Permalink
Post by Carl Banks
Post by Jan Theodore Galkowski
We've not had an excellent dynamic OO language since
Smalltalk, IMO.
I would say that "excellence" in object oriented programming is not a
strong design goal of Python. Python tries to support OOP well, but
not to enhance OOP to the detriment of other, more important goals.
okay. no quibble with that. noone said "excellence" was my goal. it
was a description of Python. if excellence in that direction were my
goal, i'd probably head Eiffel's way. i have tried that out. i don't
like it, although it has some great ideas in it.
Post by Carl Banks
Post by Jan Theodore Galkowski
Guido was opposed to modifying builtin types before Java existed.
It's similar to his opposition to dynamic syntax.
Opposition or not, the language definition is there. Surely
Smalltalk's OO style can be respected. Smalltalkers have been
doing OO in a dynamic context longer than many. There are things
to learn there.
Well, that Smalltalk and Ruby do this at least suggests that it won't
be the end of the world as we know it if it were to happen in Python.
Personally, I'm with Guido here. Allowing this might make Python's OOP
more "excellent", but it would be to the detriment of other, more
important goals, like minimizing surprise.
okay.
Post by Carl Banks
Post by Jan Theodore Galkowski
There are two things here that need to be kept straight, I think.
One is the primacy of builtin types.
The other is placing those builtins at the top of their own object
hierarchy. Is "int", properly speaking, a descendent of "object"?
No, it's the root of its own tree.
Are you saying that it shouldn't be a descendant of "object", or that
it isn't? "int" is certainly a subclass of "object" in Python (as are
all objects).
i stand corrected and, as a result of your assertion, discovered the
"super(.,.)" built-in. thanks. i'll have to think about good ways to
use that, that is, other than involving it in some kind of case logic.
Post by Carl Banks
Post by Jan Theodore Galkowski
Smalltalk has "int" as well, as a *subclass* of Number. It's
primitive.
Number is primitive? I thought all types in Smalltalk had a common
base type.
no. it was my poor phrasing. my "It" was intended to refer to "int"
not "Number".
Post by Carl Banks
Anyways, Python 3000 is exploring the idea of an abstract hierarchy
that has classes (interfaces?) like Number and Sequence. In fact, I
even saw some talk about somehow being able to retrofit classes to
support one of these interfaces/ABCs, though it was pretty conjectural.
well, and surely Python has the additional challenge of being brave
enough to tackle multiple inheritance, something Smalltalk could not do,
not directly.
Post by Carl Banks
Post by Jan Theodore Galkowski
In any case, as respectful of Mr/Dr van Rossum as I am, simply
because so-and-so says something is bad and therefore it must be true
is a fallacious response.
The same could be said of Smalltalk, i.e., because Smalltalk does it
therefore it is good is just as fallacious.
never said that, either. Smalltalk is not a person. my justification
for loose methods is what you can do and build with them, not simply
that they' in Smalltalk or Ruby.

i don't see programming languages as primary. i see programming and
design styles as primary. as i've remarked in a separate comment, if i
can eck out a niche within a language which permits me to express a
useful, perspicuous style, i'm happy.

that's all.
Post by Carl Banks
Regardless, whatever Guido pronounces is what happens. If he's
adamantly against something, it's pretty much an academic discussion.
and, as i've also remarked, i'm not interested in having Python changed
or proposing it be changed. because i'm simply seeking kindred spirits
who might have examined how to go about realizing loose methods in
Python does not at all mean i want the language somehow "fixed" to make
it just like Smalltalk.

right now, i'm just seeing how far i can take the language as it is and
what can be done with it, especially what is probably a subset. i'm
very pleased with the adventure.

and, as i've said in that other post, i'm also pleased with NumPy, since
poor numerical support is something Smalltalk always suffered from,
although there is

http://www.abebooks.com/servlet/SearchResults?sts=t&y=0&kn=smalltalk+java+numerical+methods&x=0
Continue reading on narkive:
Loading...