Concepts RE: Python evolution: Unease

R

Roman Suzi

Am I selling Snake Oil?

What I do have is a "forest" instead of an "in the trees" perspective, and
from a forest view I see a lot of defensiveness about Python's hypothetical
shortcomings. No one needs be defensive, Python is an amazing programming
language, and everyone involved with its development, evolution, support and
codebase ought to feel quite good about it.

-skip-

It's c.l.p and people are free to express their opinions. Even negative.
This helps improve Python.

As for concepts, they are from Generic Programming (by Musser and Stepanov)
and I feel that Python is in position to implement them to the fullest extent.
And IMHO it will be nicer than just Java-like interfaces or Eiffel's contract
approach.

I can try to write a PEP "Generic Programming Concepts".


Sincerely yours, Roman Suzi
 
P

Paul Rubin

Roman Suzi said:
As for concepts, they are from Generic Programming (by Musser and
Stepanov) and I feel that Python is in position to implement them to
the fullest extent. And IMHO it will be nicer than just Java-like
interfaces or Eiffel's contract approach.

I keep hearing that term (GP). Can someone explain in a few sentences
what it means, without resorting to marketing buzzwords?

There is nothing in Wikipedia about it.
 
S

Skip Montanaro

Paul> Oops: http://en.wikipedia.org/wiki/Generic_programming

Paul> This helps. But I don't see how it's different from what used to
Paul> be called polymorphism.

I think of generic programming as polymorphism for statically typed
languages. Using the example from the Wikipedia reference, you can't have a
generic List class that can hold a list of ints as well as a list of animals
without using templates.

Skip
 
R

Roman Suzi

Paul Rubin said:
There is nothing in Wikipedia about [Generic programming].

Oops: http://en.wikipedia.org/wiki/Generic_programming

This helps. But I don't see how it's different from what used to
be called polymorphism.

I already posted these links. They seem to give more fundamental
definitions than wikipedia:

'''
1. http://www.cs.rpi.edu/~musser/gp/

2. "A Formalization of Concepts for Generic Programming"
(google could find PDF of that). If I am correct, this one:
http://www.osl.iu.edu/publications/pubs/2004/willcock04:_formal_concep_gener_progr.pdf

(it is safe to skip till example on Fig.1 to grasp the idea behind
a concept. Relations between concepts are also very logical and
remind of inheritance, association and aggregation)

3. "The Boost Graph Library" by Jeremy Siek, et al with A.Stepanov's
foreword is a good way to see GP != STL.
'''

As for polymorphism, yes, polymorphism. But any decent language has some sort
of polymorphism today. The essense of concepts is that they provide
formalities for (call them) contracts, interfaces, etc. Concepts from GP
gather all these together and call it a concept: a family of similar types.

Python already uses concepts implicitly, by convention. And we know them well:
file-like objects, sequences, maps, sets, queues, arrays, etc.
My "marketing" of GP is directed to formalise on concepts instead of
partial cases (design-by-contract, interfaces etc).

Thus, concepts control polymorphism not only from liberation side, but
from constraint side too. Right now concepts in Python are reused
here and there without explicit mentioning. Concepts could help
make code even more reusable.


Sincerely yours, Roman Suzi
 
C

corey

Roman said:
On Wed, 5 Jan 2005, EP wrote:
I can try to write a PEP "Generic Programming Concepts".

That would be great. It's so hard to get your head around an abstract
concept (a thought, not a programming concept) without a concrete
example in some form of syntax. I think that's what's throwing off
most people from the idea.
And if you really do want to get it incorporated into whatever Guido is
thinking, it would probably be best to hurry. ;)
 
J

Jeremy Bowers

As for concepts, they are from Generic Programming (by Musser and
Stepanov) and I feel that Python is in position to implement them to the
fullest extent. And IMHO it will be nicer than just Java-like interfaces
or Eiffel's contract approach.

I can try to write a PEP "Generic Programming Concepts".

I'd like to see this.

As corey says, sooner rather than later is good. Release Early, Release
Often :)

I'm still skeptical on how *most* Generic Programming concepts are an
improvement, but while I don't know much about how "concepts" formally
work I know I like the name... and that's a start. I'd love to see my
skepticism proved wrong.
 

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top