Postscript Language Reference Manual
PostScript (PS) is a computer language for creating vector graphics.
It is a dynamically typed, concatenative programming language and was created by John Warnock, Charles Geschke, Doug Brotz, Ed Taft and
Bill Paxton in 1982.
It is used as a page description language in the electronic and desktop publishing areas.
PostScript is a Turing-complete programming language, belonging to the concatenative group.
Typically, PostScript programs are not produced by humans, but by other programs.
However, it is possible to write computer programs in PostScript just like any other programming language.
PostScript is an interpreted, stack-based language similar to Forth but with strong dynamic typing, data structures inspired by those found in
Lisp, scoped memory and, since language level 2, garbage collection.
The language syntax uses reverse Polish notation, which makes the order of operations unambiguous, but reading a program requires some practice,
because one has to keep the layout of the stack in mind.
Most operators (what other languages term functions) take their arguments from the stack, and place their results onto the stack.
Literals (for example, numbers) have the effect of placing a copy of themselves on the stack.
Sophisticated data structures can be built on the array and dictionary types, but cannot be declared to the type system, which sees them all
only as arrays and dictionaries, so any further typing discipline to be applied to such user-defined "types" is left to the code that implements them.
The character "%" is used to introduce comments in PostScript programs.
As a general convention, every PostScript program should start with the characters "%!PS" as an interpreter directive so that all devices will
properly interpret it as PostScript.