Monday, February 26, 2007

How to Design Programs

Looking for free versions of the functional programming language Scheme, I found an excellent resource, called How to Design Programs. It is a book which uses the user-friendly DrScheme programming environment. Of course, I downloaded DrScheme, which is available for Windows 98+, Mac OS X 10.3+ and Unix type operating systems (Linux, BSD).

So why this diversion, why go to another language, and not continue with Programming in Lua? Well, I'm still having problems understanding the concepts of functional programming, especially the concept of closure. I've researched it in Wikipedia, and found that the answers in there still weren't satisfying my hunger for knowledge and understanding. I simply need to know what this concept of "closure" is.

I've seen that closure is used in lots of places (e.g. JavaScript, although it has some memory leakage in I.E. which needs to be addressed, see Leakfree JavaScript Closures), so it seems to be a pretty important concept.

Before I had read Chapter 6.1 of Programming in Lua, I wasn't really aware of the concept of functional programming, nor that a scripting language like Lua was capable enough to do some functional programming. You would think that a scripting language is downright imperative (do this, then that). Instead, it has some functional programming features, which makes it somewhat declarative (not so much "how to do it", but rather "what should be done").

Don't be afraid, this will not become a Scheme programming blog. I just need some extra baggage to be able to properly understand and explain the concepts I'm struggling with right now.

No comments: