Ruby, Python, Lisp, and Scheme
In the last few days I refreshed my knowledge on Ruby and Lisp. I started with Ruby but eventually I came across Paul Grahams excellent book Hackers and Painters. Since I am an ACM member I have access to the book via ACM’s online books (Safari Enterprise Library). I browsed a little bit through his web site, found the online book On Lisp and became interested to Common Lisp. Yeah, it is really a language for hackers.
In ancient times, Scheme was one of my favourite language. It is quite elegant, homogeneous, and was fun to learn. Like every software addicted person I implemented a Scheme interpreter on my own.
Same with Python. I heard about Python a long time ago. Approx. same time when Tom Lord posted an article about an interesting virtual machine that became later the JVM. Even before that, I read a book about the programming language ABC. Python replaced Scheme as a favourite language because of its libraries. Since the introduction of lexical scoping in Python, I explain Python to my colleagues as a Scheme / Lisp without the braces. But of course with indentation. O.K., that’s not quite correct. I do ignore the macro system.
Learning a little more about Lisp and Ruby reveals an interesting property of both languages. Compared to Scheme and Python, they are more impure in trade of being more pragmatic. One example. In Scheme and Python most of the language contructs are also syntactically first class constructs. If you have a variable that contains a reference to a function, you can call the function as any other function:
(function para-1 para-2 ...) ; Scheme
function(para1, para2, ...) # Python
In Lisp and Ruby, you must use specific language features (function funcall in Lisp, method call in Ruby). You trade these necessities for easier handling in ordinary programming. Separate name spaces in Lisp, method call without parentheses in Ruby. Just an example.
After learning a lot about Lisp, I will concentrate more on Ruby for the next time. Python/Ruby shares an important property compared to Scheme/Lisp: they have much more mature libraries, e.g. for database access or internet protocols.
Unfortunately, my customer just uses Java in his projects. Maybe I am able to place subversively a Scheme/Lisp system written in Java …