> The training wheels make the point that Python lacks the speed
> necessary for serious applications. On the other hand, Java and C#
> demand huge downloads. As a user, I often give up an application when
> I see the size of the downloads (dotNet framework plus the
> application).
They do not demand huge downloads -- user can have .net or Java runtime
already installed. It is a matter of bundling your software.
I think it is typical for Java runtime to be installed separately, not
being bundled with software.
> I cannot understand why Python is so slow,
There are two reasons:
* it isn't designed for speed, unlike Common Lisp which took into
account decades of research (Python's author disregarded them for
simplicity)
* CPython is a slow interpreter, again built for simplicity
There are clever Python JIT compilers which make it much faster. E.g.
Psyco and PyPy.
> and Java/
> dotNet based software distributions require such huge downloads.
Again, it's not required.
> SBCL has a nice REPL with the looks and feel of interpreted code;
> nevertheless it is fast.
SBCL is slow at compiling and fastloading. Check CCL.
> Why Python cannot be at least as fast as SBCL
> or Clozure?
There is a number of reasons.
For example, Python name resolution requires hash table lookup at
runtime, e.g. when you call foo.bar it is a lookup in hash table foo for
symbol bar. In CL symbols are resolved at read time and further lookups
are just pointer dereferences.
Common Lisp has optional type annotations which enable type inferences.
There is a number of other things which are thought-out in CL but are
simplest in Python.
CL was made by top professionals when computers were slow. They simply
couldn't afford making it slow.
Python was made by one guy for purpose of teaching programming or
something. He simply wasn't giving a fuck.
But there are some black magic techniques to make Python faster.
> I don't think that it has anything to do with syntax,
Syntax too. CL has no syntax for namespace lookups in runtime.
But it's about semantics. CL has very straightforward execution model:
read -> macroexpand -> compile -> execute
Each step is separated. Spec describes with a great care what
implementation can and cannot do and it tries to leave absolute minimum
of work during execution.
> since I use an extended version of Katrowitz'
infix.cl without
> noticeable loss of speed.
Sure, it has nothing to do with having prefix notation. I guess the main
reason lies in history: Lisp implementations were made in top
universities by top CS students, and hardware limitations made them want
to make them fast.
> I wonder whether clpython could be compiled in such a fashion as to
> approach the speed of SBCL.
I don't see how type annotations could fit into Python language so it
won't be as fast as SBCL. But probably still faster than CPython just
because certain things can be inlined and optimized out.