Postscript tree

A recursive tree

Postscript is one of these old technologies that seem like they will never die. Launched in 1984, it is still in used today, en though it has been partly supplanted by PDF. The difference between the two data formats is in fact pretty foggy for many people – yet there is one important one: PostScript is a Turing Complete language.

This means a short Postscript file might execute for a very long time, or for ever. This also means that a Postscript file might render different things. To show this, I wrote – years ago – a small Postscript program which draws a tree. The file is pretty short, 1533 bytes, yet it will take quite some time to render it, so please don’t sent it to the printer a work at a busy time. The tree should be slightly different each time you render it.

The fact that you could write Postscript files directly was a common idea when I was at the University, both the compilation course given by Jacques Menu and the analysis course given by Gerhard Wanner contained examples of doing so (in the latter case, Postscript was generated from Fortran).

Update: I also added a variant of the tree with a lesser level of recursion, and a version of the Koch snow-flake.

3 thoughts on “Postscript tree”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.