[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Python for Lisp Programmers"



At 03:35 PM 12/6/01, Paul Prescod wrote:
>Scott McKay wrote:
> >
> > ...
> >
> > Peter draws a pretty good 1-to-1 (and "onto") mapping from CL
> > to Python, which makes me wonder how Lisp can be heavy
> > (which I think it is) and Python can be light (which I have not
> > decided about).
>
>What about things like the CLOS MOP, generic functions, optional type
>annotations and macros?

Don't worry, van Rossum seems smart.  I'll bet that generic functions,
type annotations, and macros will appear in Python sometime.  :-)

Please note that most of the CLOS MOP is *not* part of Common Lisp,
even though most CL implementations support most of it.

FWIW, I think that generic functions make a language lighter than
having class-based OO.  And *optional* type declarations that are
well-integrated into the language don't really add any weight, because
you don't have to use them.

Finally, in my experience, macros are the key to making domain-specific
libraries light, since they can so radically simplify APIs.

>Also, part of what makes Python lightweight is the libraries. There are
>built-in libraries (standardized across implementations and platforms)
>for doing the sort of hacking that most programmers need to do today:
>file manipulation, sockets, HTTP, HTML and XML. A distribution of Common
>Lisp might be lighweight if it supported the same stuff, but CL the
>standard predates many of the technologies that programmers need to work
>with.

Presumably you mean "Python itself is light because its weighty bits
are distributed in libraries", right?  If so, I need to point out that 
there are
CL libraries for sockets, HTTP, HTML, and XML as well.  And it's easy
to conceive of a language -- let's call it CL-- -- which is exactly like CL
except that chunks of its functionality are simply moved, otherwise
unchanged, to libraries.  Would CL-- be light-weight after doing this
sleight-of-hand?

>If we agreed that Python were heavy, then what of Perl? And what is
>left, just Scheme?

Perl is about as light-weight as a brontosaurus, but that's just my opinion
based on my "small, reasonably orthogonal core", which Perl lacks in spades.

Scheme is undeniably light-weight.

BTW, I'm not trying to *prove* that CL is light-weight, because I think that
it is not.  What I am trying to winkle out is, why do some people think
that Python *is* light-weight, when Python is sooooo close to CL in so
many ways?  I'm picking these two languages precisely because they
are so similar, yet the perception of them is so different.