Wednesday, June 21, 2006

python

Python

I've become somewhat hooked on Python. Sarah has sung its praises for some time, but I didn't really investigate in any great detail until recently. It's fast, lightweight, and has some fun functional programming features, plus the wonderfully handy list comprehensions. I'm using it at work currently, and also for a couple of personal projects.

In Python, whitespace is syntactically relevant. This is certainly one of the language's most talked-about features, albeit mainly by non-Python users who almost universally decry it as an abomination. Odd it may be, initially, but I have gotten to really like it. EMACS has a nice mode for handling it.

And that brings me to the alleged LISPyness. People are always going on about how Python is like LISP. Now, a lot of this can be put down to the functional constructs and the strong dynamic typing. But many other languages have those, and aren't so compared. I think the reason for the frequent comparison may be somewhat subliminal; Python is the same shape as LISP. The lack of terminating statements or curly brackets gives Python and LISP functions a "going-right" look, and the LISP mandated indentation style, as fairly universally practised, is quite like the Python syntactically-relevant indentation style.

As a matter of fact, I wish it was more like LISP; in particular, macros and symbols would be nice.

No comments:

Post a Comment