HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, Pic is a
domain-specific Domain specificity is a theoretical position in cognitive science (especially modern cognitive development) that argues that many aspects of cognition are supported by specialized, presumably evolutionarily specified, learning devices. The posit ...
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
by
Brian Kernighan Brian Wilson Kernighan (; born January 30, 1942) is a Canadian computer scientist. He worked at Bell Labs and contributed to the development of Unix alongside Unix creators Ken Thompson and Dennis Ritchie. Kernighan's name became widely known ...
for specifying line
diagram A diagram is a symbolic Depiction, representation of information using Visualization (graphics), visualization techniques. Diagrams have been used since prehistoric times on Cave painting, walls of caves, but became more prevalent during the Age o ...
s. The language contains predefined basic linear objects: line, move, arrow, and spline, the planar objects box, circle, ellipse, arc, and definable composite elements. Objects are placed with respect to other objects or absolute coordinates. A liberal interpretation of the input invokes default parameters when objects are incompletely specified. An interpreter translates this description into concrete drawing commands in a variety of possible output formats. Pic is a
procedural programming language Procedural programming is a programming paradigm, classified as imperative programming, that involves implementing the behavior of a computer program as procedures (a.k.a. functions, subroutines) that call each other. The resulting program is a ...
, 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 Bentley Motors Limited is a British designer, manufacturer and marketer of Luxury vehicle, luxury cars and Sport utility vehicle, SUVs. Headquartered in Crewe, England, the company was founded by W. O. Bentley (1888–1971) in 1919 in Crickle ...
1988).


History

Pic was implemented using
Yacc Yacc (Yet Another Compiler-Compiler) is a computer program for the Unix operating system developed by Stephen C. Johnson. It is a lookahead left-to-right rightmost derivation (LALR) parser generator, generating a LALR parser (the part of a co ...
compiler-compiler.


Implementations

Pic was first implemented as a
preprocessor In computer science, a preprocessor (or precompiler) is a Computer program, program that processes its input data to produce output that is used as input in another program. The output is said to be a preprocessed form of the input data, which i ...
in the
troff troff (), short for "typesetter roff", is the major component of a document processing system developed by Bell Labs for the Unix operating system. troff and the related nroff were both developed from the original roff (software), roff. Whil ...
document processing system but is now often used with
LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latices are found in nature, but synthetic latices are common as well. In nature, latex is found as a wikt:milky, milky fluid, which is present in 10% of all floweri ...
. The pic preprocessor
filters Filtration is a physical process that separates solid matter and fluid from a mixture. Filter, filtering, filters or filtration may also refer to: Science and technology Computing * Filter (higher-order function), in functional programming * Fil ...
a source document, replacing diagram descriptions by drawing commands in a specified format, and passing the rest of the document through without change. Alternatively, diagram source is passed through the preprocessor to produce a file for insertion into the document source. A version of pic is included in groff, the
GNU GNU ( ) is an extensive collection of free software (394 packages ), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operating systems popu ...
version of troff. GNU pic can also act as a preprocessor for
TeX Tex, TeX, TEX, may refer to: People and fictional characters * Tex (nickname), a list of people and fictional characters with the nickname * Tex Earnhardt (1930–2020), U.S. businessman * Joe Tex (1933–1982), stage name of American soul singer ...
documents, emitting its own tpic DVI specials, which aren't as widely supported as those of other TeX graphic facilities. Arbitrary diagram text can be included for formatting by the word processor to which the pic output is directed, and arbitrary graphic processor commands can also be included.


DPIC

Dwight Aplevich's implementation
DPIC
can also generate pdf, postscript, svg, and other images by itself, as well as act as a preprocessor producing several
LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latices are found in nature, but synthetic latices are common as well. In nature, latex is found as a wikt:milky, milky fluid, which is present in 10% of all floweri ...
-compatible output formats. The three principal sources of pic processors are GNU pic, found on many
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
systems, and dpic, both of which are free, and the original AT&T pic.


Pikchr

'
Pikchr
'' (pronounced "picture") is a modern replacement for Pic in some contexts, designed to be embedded in
Markdown Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber created Markdown in 2004 as an easy-to-read markup language. Markdown is widely used for blogging and instant messaging, and also used ...
, instead of
troff troff (), short for "typesetter roff", is the major component of a document processing system developed by Bell Labs for the Unix operating system. troff and the related nroff were both developed from the original roff (software), roff. Whil ...
or
LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latices are found in nature, but synthetic latices are common as well. In nature, latex is found as a wikt:milky, milky fluid, which is present in 10% of all floweri ...
. It should run most of the example scripts contained in the original technical report on Pic with little to no change. Created by D. Richard Hipp, in August 2020, it is used in
Fossil A fossil (from Classical Latin , ) is any preserved remains, impression, or trace of any once-living thing from a past geological age. Examples include bones, shells, exoskeletons, stone imprints of animals or microbes, objects preserve ...
,
SQLite SQLite ( "S-Q-L-ite", "sequel-ite") is a free and open-source relational database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it ...
, an
Subplot


Alternatives

Pic has some similarity with MetaPost and the
DOT language DOT is a Graph (discrete mathematics), graph description language, developed as a part of the Graphviz project. DOT graphs are typically stored as Computer file, files with the .gv or .dot filename extension — .gv is preferred, to avoid confusi ...
.


See also

* Eqn language


References

;Notes * *J. Bentley. ''More Programming Pearls'', Addison-Wesley (1988).


External links


Making Pictures With GNU PIC



DPIC
an implementation of the PIC language by Dwight Aplevich. This implementation has a few nice extensions and outputs many different image formats.
figr
web based pic renderer. *

"''takes one or more files in the pic language, and either displays the figures that they contain on an X Window System display, or produces an output file containing the figures. Many graphics file formats are supported.''"
Pikchr
{{Programming languages Programming languages Markup languages Troff Programming languages created in 1980 1980 software