2010/04/07

Forth

The Forth programming language is a structured language that use reverse polish notation. For some, it will bring back in days of first HP calculators, for others, like me, Postscript and assembler.

So what's reverse polish notation ? Well, if you want to add 2 to 3, you will write it the operand first then the operator :

2 3 + .

(The final dot means process the equation)

If you type the previous code in Open Firmware, then press Enter key, you will get :

2 3 + . 5 ok

If there's an error in the code, the error message will be shown instead of 'ok'. But there's more than simple equations in Forth. Armit Singh have built an Hanoi tower solver in Open Firmware! Even a variant with graphics. In fact, the creator of Forth, Chuck Moore, had planned to use it in a multicore chip.