Graphics in its various forms has fascinated me for a while. Way back when (around 1998-2000) I took an interest in the PostScript language. I had used PostScript printers before (my first experience was an OkiLedPrinter, then an HpLaserjetFour), but I had no clue what those streams of 'bind def etc' words actually meant. I am a curious character, so followed a few online tutorials and got up a few basic examples of PostScript (in particular, a koch curve, a cantor set, and a few other shapes that are easy to generate procedurally). A year or so later, a then-girlfriend needed a map on which to mark a few crosses (that is, the kind you find in a churchyard). All I could locate online was a bitmap image of the map, and a simple path tracing plugin for fse/GimpImageEditor. Thus the quickest solution was to edit the bitmap image of the map, to make it easy for the tracer, then trace it and dump the path as a text file, use a prl/PerlLang script to turn this into a postscript file which drew the map on an A4 sheet of paper, add a quick function to draw a cross and label, and proceed to manually locate the positions of the crosses (using gv on Linux). In not too long, I had a working PostScript file which could be dumped out of a compatible printer (which thankfully the university physics computer lab had a few of). Problem solved.

I loved the simplicity of basic postscript, although naturally one could make improvements. prl/ForthLike languages are handy for many things, but it would be better to have something more prl/LispLike for the more complex bits, but still with the facility to create shorthands as necessary. What I consider to be a common mistake of language designers is to design a language to be universal. This is a security nightmare since the mlc/HaltingProblem and related issues guarantee a certain lack of predictability. Rather, as demonstrated by os/CapabilitySecurity, one should apply the os/PrincipleOfLeastAuthority at the language level, using multiple simple scoped languages, following a common syntax, such that only those facilities necessary to the task are present. In particular, one can then apply strict resource constraints and ban arbitrary looping. Naturally this precludes third part binaries, as is the norm with proprietary software, but having software in a form which makes it easy to check its behaviour is, in the long run, a good thing. The complexity and resulting wall of effective secrecy, whilst good for greed and moneymaking, makes security, understanding and maintainability a nightmare. Rather, things must be kept simple.

Part of my desire is to roll back the years to a simple PostScript like graphics library, recreating the early voyage of discovery before the commercial explosion which popularised PostScript. Since PostScript is proprietary, but GhostScript is freely available, I will start with an early version (5.1) of GhostScript as a reference implementation, and possibly a later one that my current machine can actually compile. Version 8.62 builds on my laptop with minimal issues (configure decided I didn't have sys/time.h when I did, so I had to make a quick fix for that).

I will begin with a recap of BasicPostScript.