In computing, Pic is a domain-specific programming language by Brian Kernighan for specifying diagrams in terms of objects such as boxes with arrows between them. The pic compiler translates this description into concrete drawing commands. Pic is a procedural programming language, with variable assignment, macros, conditionals, and looping. The language is an example of a little language originally intended for the comfort of non-programmers in the Unix environment (Bentley 1988).
Pic was first implemented, and is still most typically used, as a preprocessor in the troff document processing system. The pic preprocessor filters a troff document, replacing diagram descriptions by concrete drawing commands, and passing the rest of the document through without change.
A version of pic is included in groff, the GNU version of troff. GNU pic can also act as a preprocessor for TeX documents, emitting its own tpic DVI specials, which unfortunately aren't as widely supported as those of other TeX drivers (like PostScript). Arbitrary diagram text can be included for formatting by the word processor to which the pic output is directed, and arbitrary post-processor commands can also be included. Dwight Aplevich's implementation, DPIC, can also generate postscript or svg images by itself, as well as act as a preprocessor. The three principal sources of pic processors are GNU pic, found on many Linux systems, and dpic, both of which are free, and the original AT&T pic.
- Kernighan, Brian W. (1982). "PIC - A Language for Typesetting Graphics". Software Practice Experience (12): 1–20.
- J. Bentley. More Programming Pearls, Addison-Wesley (1988).
- Making Pictures With GNU PIC
- Troff resources (see the "pic" section)
- Janert, Philipp K. (June 21, 2007). "In Praise of Pic". ONLamp.com. O'Reilly Media. Retrieved 2011-09-06.
- DPIC, an implementation of the PIC language by Dwight Aplevich. This implementation has a few nice extensions and outputs many different image formats.
- figr[dead link], web based pic renderer.
- Brian W. Kernighan (1991). PIC — A Graphics Language for Typesetting. User Manual (PDF). CSTR #116 (Technical report) (Revised ed.). Bell Laboratories.
|This programming-language-related article is a stub. You can help Wikipedia by expanding it.|