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.
PostScript is a Turing-complete programming language, belonging to the concatenative group. This means that any program you can write in any programming language, you can write in PostScript (albeit it will be slower).
PostScript files are (generally) plain text files and as such they can easily be generated by hand or as the output of user written programs. As with most programming languages, postscript files (programs) are intended to be, at least partially, human-readable.
Here’s our recommended free books to learn PostScript.
1. Mathematical Illustrations by Bill Casselman
Mathematical Illustrations shows the reader how to use PostScript for producing mathematical graphics, at several levels of sophistication. It includes also some discussion of the mathematics involved in computer graphics as well as a few remarks about good style in mathematical illustration.
The early chapters (1, 3–6) offer an introduction to basic features of the language. Chapters 2 and 12 offer accounts of coordinate geometry in 2D and 3D. Chapters 7–10 explore more sophisticated features of PostScript in 2D, as well as how mathematics and graphics algorithms interact in interesting ways. The remaining chapters explore three dimensions, using a library of PostScript procedures designed for the purpose.
2. Postscript Language Reference (Third Edition) by Adobe Systems
The PostScript Language Reference, known as the Red Book, is the complete and authoritative reference manual for the PostScript language. Prepared by Adobe Systems Incorporated, the creators and stewards of the PostScript standard, it documents the syntax and semantics of the language, the Adobe imaging model, and the effects of the graphics operators.
This Third Edition has been updated to include LanguageLevel 3 extensions, which unify a number of previous extensions and introduce many new features, such as high-fidelity color, support for masked images, and smooth shading capabilities.
3. Taking Advantage of PostScript
Taking Advantage of PostScript is divided into four major parts.
Chapters 2–7 of this book introduce some basic PostScript concepts and drawing techniques. Chapter 4 shows how these simple programs can be saved as EPS files to be used within other programs. Most of the simple beginning programs are more easily drawn in a variety of graphics software programs, but they are the building blocks to the more complicated programming techniques that come in later chapters.
Chapters 8–17 cover advanced PostScript techniques that unleash the power of the PostScript Page Description Language. Much of what is covered here cannot be accomplished in available graphics software. Chapter 17 covers some advanced programming techniques and takes several designs step by step and explains how and why they were written as they are. Chapter 18 touches on some of the new features of PostScript Level 2.
Chapters 19 and 20 of this book are libraries of numerous examples of PostScript programs that can be the starting point for new designs. They generally concentrate on one visual idea or programming technique. Chapter 21 is a gallery of images.The final section of the book contains several reference appendixes.
4. A First Guide to PostScript by Peter Weingartner
A First Guide to PostScript is a simple introduction to programming in the PostScript page description language from Adobe. This document is not meant to be a comprehensive reference manual (although it does contain an index of some of PostScript’s standard operators and a list of various errors). This is meant as an easily accessible on-line tutorial. It was written with the assumption that you have some experience programming and are familiar with concepts like arrays and variables.
The new version is published under the Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.
All books in this series:
|Free Programming Books|
|Java||General-purpose, concurrent, class-based, object-oriented, high-level language|
|C||General-purpose, procedural, portable, high-level language|
|Python||General-purpose, structured, powerful language|
|C++||General-purpose, portable, free-form, multi-paradigm language|
|C#||Combines the power and flexibility of C++ with the simplicity of Visual Basic|
|PHP||PHP has been at the helm of the web for many years|
|HTML||HyperText Markup Language|
|SQL||Access and manipulate data held in a relational database management system|
|Ruby||General purpose, scripting, structured, flexible, fully object-oriented language|
|Assembly||As close to writing machine code without writing in pure hexadecimal|
|Swift||Powerful and intuitive general-purpose programming language|
|Groovy||Powerful, optionally typed and dynamic language|
|Go||Compiled, statically typed programming language|
|Pascal||Imperative and procedural language designed in the late 1960s|
|Perl||High-level, general-purpose, interpreted, scripting, dynamic language|
|R||De facto standard among statisticians and data analysts|
|COBOL||Common Business-Oriented Language|
|Scala||Modern, object-functional, multi-paradigm, Java-based language|
|Fortran||The first high-level language, using the first compiler|
|Scratch||Visual programming language designed for 8-16 year-old children|
|Lua||Designed as an embeddable scripting language|
|Logo||Dialect of Lisp that features interactivity, modularity, extensibility|
|Rust||Ideal for systems, embedded, and other performance critical code|
|Lisp||Unique features - excellent to study programming constructs|
|Ada||ALGOL-like programming language, extended from Pascal and other languages|
|Haskell||Standardized, general-purpose, polymorphically, statically typed language|
|Scheme||A general-purpose, functional language descended from Lisp and Algol|
|Prolog||A general purpose, declarative, logic programming language|
|Forth||Imperative stack-based programming language|
|Clojure||Dialect of the Lisp programming language|
|Julia||High-level, high-performance language for technical computing|
|Awk||Versatile language designed for pattern scanning and processing language|
|BASIC||Beginner’s All-purpose Symbolic Instruction Code|
|Erlang||General-purpose, concurrent, declarative, functional language|
|VimL||Powerful scripting language of the Vim editor|
|OCaml||The main implementation of the Caml language|
|ECMAScript||Best known as the language embedded in web browsers|
|Bash||Shell and command language; popular both as a shell and a scripting language|
|LaTeX||Professional document preparation system and document markup language|
|TeX||Markup and programming language - create professional quality typeset text|
|Arduino||Inexpensive, flexible, open source microcontroller platform|
|Elixir||Relatively new functional language running on the Erlang virtual machine|
|F#||Uses functional, imperative, and object-oriented programming methods|
|Tcl||Dynamic language based on concepts of Lisp, C, and Unix shells|
|Factor||Dynamic stack-based programming language|
|Eiffel||Object-oriented language designed by Bertrand Meyer|
|Agda||Dependently typed functional language based on intuitionistic Type Theory|
|Icon||Wide variety of features for processing and presenting symbolic data|
|XML||Rules for defining semantic tags describing structure ad meaning|
|Vala||Object-oriented language, syntactically similar to C#|
|Standard ML||General-purpose functional language characterized as "Lisp with types"|
|D||General-purpose systems programming language with a C-like syntax|
|Dart||Client-optimized language for fast apps on multiple platforms|
|Markdown||Plain text formatting syntax designed to be easy-to-read and easy-to-write|
|Kotlin||More modern version of Java|
|Objective-C||Object-oriented language that adds Smalltalk-style messaging to C|
|VHDL||Hardware description language used in electronic design automation|
|J||Array programming language based primarily on APL|
|LabVIEW||Designed to enable domain experts to build power systems quickly|
|PostScript||Interpreted, stack-based and Turing complete language|
|Raku||Member of the Perl family of programming languages|
|Dylan||Multi-paradigm language supporting functional and object-oriented coding|