Friday, February 8, 2008

Common Lisp vs Python: code size

Just joke :)

I know, it is not enough statistics for conclusions :)

We have compared reduce statement in Common lisp and python with one fellow.
I wrote in Common lisp, he in Python.

Resulting "code" sizes for same construct, just translated from one language to another:


$ echo "reduce(lambda x,y: (x,y,x), (1,2,3,4))" | wc
1 4 39
$ echo "(reduce (lambda(x y)(list x y x)) (list 1 2 3 4))" | wc
1 11 50
Python : 39 symbols long
Common Lisp : 50 symbols.


And the winner is Python :)
Python win about 20 or 25 percents of code size.

No comments: