[Python-Dev] Reduce memory footprint of Python

R. David Murray rdmurray at bitdance.com
Tue Oct 8 21:39:18 CEST 2013


On Tue, 08 Oct 2013 14:43:03 -0400, Benjamin Peterson <benjamin at python.org> wrote:
> 2013/10/8 R. David Murray <rdmurray at bitdance.com>:
> > PS: I have always thought it sad that the ready availability of memory,
> > CPU speed, and disk space tends to result in lazy programs.  I understand
> > there is an effort/value tradeoff, and I make those tradeoffs myself
> > all the time...but it still makes me sad.  Then, again, in my early
> > programming days I spent a fair amount of time writing and using Forth,
> > and that probably colors my worldview. :)
> 
> In defense of my weak-kneed generation, one of major principles of
> programming as I understand it is to be as lazy as possible. (That is,
> have the machine do the work. :))

Yeah, that's a commonplace...but the obvious interpretation misses the
point, really, which I'm guessing is why you included the smiley.

It is not so much a matter of being as lazy as possible, as of being as
*smart* as practical[*] up front.  Frontload all the work (and it can be
a *lot* of work, which is why the aphorism is tongue-in-cheek) into the
design and algorithms and tools, then be amazingly productive using them.
That's really part of Python's fundamental design philosophy, I think.

In this context, if we'd been *really* smart-lazy in CPython development,
we'd have kept the memory and startup-time and...well, we probably do
pretty well on CPU actually...smaller, so that when smartphones came
along Python would have been the first high level language used on them,
because it fit.  Then we'd all be able to be *much* lazier now :)

--David

[*] The opposite part of that zen[**] being "if you make the code as smart
as possible, you won't be smart enough to debug it".

[**] Hmm.  I wonder if our "zen" is really a dialectic?


More information about the Python-Dev mailing list