BOTW: Programming Forth

It has been a while since I’ve written one of these Sunday posts. During the holidays I’ve been in a hectic mixture of both business and illness. But the reading I did during that time went towards ‘Programming Forth’ by Stephen Pelc.

Forth? What?

Forth is a stack-based programming language. I would feel confident guessing that Forth is associated with that paradigm more than any other language, even though assembly is often stack-based and is (surely) used more than Forth. Check out Factor if you want to see a modern Forth-like language.

The book I read, however, focuses on the old-school ANS Forth, standardized in 1994. It remains useful despite its age. While the ANS Forth standard has grown over the years it has left the fundamentals unchanged. So everything the author writes about execution tokens, the data stack versus the return stack, extending the language with ‘immediate words’, etc., is relevant information for all flavors of Forth (in my experience). The author does resort to some uses of VFX Forth, but he explicitly notes these and how they diverge from the standard.

Stephen Plec’s book feels like a nice combination of a textbook and a reference. As he says in the introduction:

This book concentrates on introducing people who already know some programming to ANS Forth systems.

In other words, it is best to approach the book only if you are competent enough in another language to such a degree that you can comfortably compare and contrast them. Forth has a lot of uncommon qualities and the author employs comparisons to more ‘normal’ imperative languages as a teaching aid. The result is effective.

If you’re a programmer curious about Forth then ‘Programming Forth’ is a nice read. It nicely covers the foundation of the language and after finishing it you’ll be ready to write software using an implementation like Gforth. Or implement your own Forth, a fun learning experience in my opinion.

Next Book of the Week

‘Retro Gaming Hacks’ by Chris Kohler. Looks like that will be a fun romp through nostalgia.

Advertisements

Add Your Thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s