Monday, January 24, 2005

Thinking Forth

Let's start off things with a quote:
    "The programmer using a batch-compiler language can seldom achieve the productive state of mind that artists achieve when the creative current is unhindered."

Do I have your interest? This is the best quote I've read to describe the productivity gain that we Smalltalkers, Lisps, Rubyers, Perlers, Pythoners, and Javascripters enjoy. I just love this quote! Anyway...

Why am I bringing this quote up? Well, I was sick all weekend and in times of conscienceness, I could only read my blog feeds. I came across one from Planet Lisp about Forth. I decided to download the book, "Thinking Forth" from here that they had linked to. The thing that got my interest was mention that this book had a lot of the principles of XP programming in it (it was written in 1984). Now, I feel a lot of the XP ideas also came from "The Pyschology of Computer Programming", so another book to fill in the gaps is a nice addition. So, between naps, I read the preface today and it seems Forth is another "everything" language. For example, "everything" in Smalltalk is an object. It seems every language that I like has a simple underlying set of rules and model to govern everything. Forth is no different. I was so impressed with the preface that I picked Forth to be my language of the year over Python. In Forth, "everything" is a word! WOW! That sounds nuts doesn't it?! Let me continue...

You label things in Forth with a word. When you invoke a "word", it doesn't care if that word stands for a constant, variable, or function. It doesn't care. Andres Valloud has recently been pounding home the idea of distinctions (ala "Laws Of Form"). But, I've been having a hard time wrapping my mind around it. It seemed too simple. Well, it snapped today after reading the preface to "Thinking Forth". If you think of "words" as "labeling distinctions" and when you invoke a "word", you are "crossing into a distinction". It goes further too. Forth uses a simple stack mechanism to pass variables around. This is the "signal" that Andres loves to tell me about as well. I was so excited that I finally got it! And I did it while on cold medicine! Yippee! So, Forth might be the language where I get to play with distinctions.

I'm excited! Hopefully, Forth will turn out to be a language that increases my knowledge of programming as much as Smalltalk and Lisp have. I'm off to sleep more...=) Being sick sucks!

No comments: