Why is Python popular, while Lisp and Scheme aren't?

Martti Halminen martti.halminen at kolumbus.fi
Mon Nov 11 22:00:58 EST 2002


Neil Schemenauer wrote:

>     (defun parse-float (s)
>       (let ((*read-eval* nil))
>         (read-from-string s)))
> 
>     (defun doit ()
>       (dotimes (i 100000)
>         (parse-float "3.1415927")))
> 
>     (time (doit))
> 
> takes 1.507 seconds on my machine using SBCL.  The corresponding Python
> code takes 0.19.

read-from-string isn't quite as good as a purpose-built parse-float;
there isn't one in the ANSI standard, though. 
On my machine, using the parse-float from CMU AI repository, I get 50 %
shorter runtime than with this read-from-string trick.
- Should perhaps take a look at the corresponding Python part, whether
it does the same thing. Often some CL parts are slower than
corresponding operations in other languages due to more thorough error
checking or handling more odd cases.

--



More information about the Python-list mailing list