Re: Re: Re: class proposal

Greg Ewing <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Mark Hahn <[email protected]>:

> So python has moved the complications up into the Objects.  That doesn't
> seem very efficient.  It's as if they built a complex language on top of a
> simple one.

I thought you were in favour of building more featureful systems
in terms of simpler ones. Isn't that just what you're proposing
to do by building classes on top of prototypes?

> The optimization I am planning of caching the prototype chain lookups needs
> to be at the heart of the interpreter.  I could never do that if it was
> layered on top of some other interpreter.

The code in Python which implements attribute lookup in the MRO is
written in C. It's not written in Python, if that's what you thought
Leonard meant. And there's no reason it couldn't maintain a cache if
it wanted to.

All the stuff Leonard was talking about happens in C. Whether you
consider it part of the interpreter or not depends on your point of
view. There's very little, if any, performance penalty for structuring
it the way it is.

> I don't know about class implementation but I would suspect that
> Python is suffering a similar problem from their architecture.

Mark, it would be a good idea if, instead of "suspecting" that Python
has this or that problem, you took the time to find out how Python
actually works and what is problems *really* are.  Then you could put
your effort into solving real problems instead of imaginary ones. :-)

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
[email protected]	   +--------------------------------------+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.