Classic programming

tony duell ard at p850ug1.demon.co.uk
Fri Aug 7 14:30:54 CDT 2015


I am not a programmer, but...

> A few years ago I developed quite an interest in PostScript, and
> through it discovered Forth and bits of other stack-based languages.

I love stack-based languages in general (Forth was the first high-level-ish language I 
learnt after BASIC (which in turn I learnt after SC/MP machine code). I particularly like
RPL, the language used on the HP28/48/49/50 series of calculators.

You can put just about anything on the stack. Real numbers, integers, unit objects (real numbers with
attached measurement units), binary numbers, strings, vectors, matrices, lists (of anything), programs (!), etc. 

Operators do what you'd expect so '+' applied to 2 reals pops them and pushes their sum. Applied
to 2 strings, it pops them and pushes the concatenation of the strings.  And so on.

Not many languages let you built up what looks like a program in a string (using the normal string
operators) then turn that string into a program (also on the stack) and then execute it. 

-tony


More information about the cctech mailing list