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).
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”
The only program that could open the file on Windows was Ghostscript. Gimp, LODraw, Adobe and Inkscape all failed.
Interesting, Mac OS X preview and Photoshop Elements 9 render it fine (takes a lot of time).
Here is a version with lower recursion.
You can basically change the depth of the tree by change the ‘max’ variable, at line 9 of the source file.
This online viewer displays the tree http://view.samurajdata.se/psview.php?id=ed9e593e&page=1&size=full