« Irish OpenSolaris Users Group Meeting | Main | Two good articles on LISP »
June 10, 2006
Scheming
I have started learning Scheme for fun and (hopefully) profit. I have been learning from a number of sources. Firstly, I have after learning the basics, I wrote another program to calculate the digits of π. The code is here (pretty printed). The algorithm I used is the same as the one I used for the python program and the two programs look very similar. I haven't yet learned how to code up closures in Scheme, so the method of calculating the Fibonacci terms to use is different, but apart from that they are pretty much the same.
Secondly, I found a few good online resources:
- The Structure and Interpretation of Computer Programs: This book is used as the textbook for MIT's famous course 6.001. It is an excellent book that very quickly shows its reader how to solve interesting problems using Scheme. For example, before the first chapter is finished, programs to evaluate derivatives of functions at a point, to calculate integrals, and a few methods of calculating square roots, have been discussed. This book is a classic and is also known as the Wizard Book. I bought paper copy: it really is that much of a classic.
- MIT Open Courseware for 6.001. I found this via a good article on the O'Reilly Network site, entitled Learn Lisp From MIT—for Free!!!
- Teach Yourself Scheme in Fixnum Days: This book gives a very good introduction to the syntax and structure of Scheme and is a handy reference.
- The schemers.org website.
I use Kawa and SISC as scheme interpreters. Both of these run on top of the Java VM and are easy to use and fit in well on UNIX/Linux systems. Running on top of the Java VM opens up some possibilities such as using the Java VM Dtrace probes to observe Scheme programs. I am not sure how well this will work, but it is something I will be investigating.
Why am I learning Scheme? Well, there are a few reasons. I really admire Paul Graham's essays and his essays on LISP and strong advocacy piqued my interest in the language. I also came across an essay describing design patterns supported by LISP. Many of the patterns I use regularly in Java programs, such as the Visitor pattern, Command pattern, and Iterator pattern, are not needed in LISP: they are built in at the language level. Because of this, I wanted to learn more and, although I have just started, I am sure this is going to make me a better programmer.
Posted by JohnC at June 10, 2006 07:57 PM