Portable C Compiler
Encyclopedia
The Portable C Compiler (also known as pcc or sometimes pccm - portable C compiler machine) is an early compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 for the C programming language written by Stephen C. Johnson
Stephen C. Johnson
Stephen Curtis Johnson spent nearly 20 years at Bell Labs and AT&T where he wrote yacc, lint, spell and the Portable C Compiler machine .Johnson earned his PhD in mathematics but has spent his entire career in computer science...

 of Bell Labs
Bell Labs
Bell Laboratories is the research and development subsidiary of the French-owned Alcatel-Lucent and previously of the American Telephone & Telegraph Company , half-owned through its Western Electric manufacturing subsidiary.Bell Laboratories operates its...

 in the mid-1970s, based in part on ideas from Alan Snyder in 1973.

One of the first compilers that could easily be adapted to output code for different computer architectures, the compiler had a long life span. It shipped with BSD Unix
Berkeley Software Distribution
Berkeley Software Distribution is a Unix operating system derivative developed and distributed by the Computer Systems Research Group of the University of California, Berkeley, from 1977 to 1995...

 until the release of 4.4BSD in 1994 - when it was replaced by the GNU C Compiler. It was very influential in its day, so much so that at the beginning of the 1980s, the majority of C compilers were based on it.

Features

The keys to the success of pcc were its portability
Porting
In computer science, porting is the process of adapting software so that an executable program can be created for a computing environment that is different from the one for which it was originally designed...

 and improved diagnostic capabilities:
  • The compiler
    Compiler
    A compiler is a computer program that transforms source code written in a programming language into another computer language...

     was designed so that only a few of its source
    Source code
    In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

     files
    Computer file
    A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...

     were machine-dependent
    Machine-dependent
    Machine-dependent is a term for application software that runs only on a particular type of computer. Conversely, applications that run on a variety of different types of computers are called machine-independent, or cross-platform....

    .
  • It was relatively robust to syntax error
    Syntax error
    In computer science, a syntax error refers to an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language....

    s and performed more thorough validity checks.


The first C compiler written by Dennis Ritchie
Dennis Ritchie
Dennis MacAlistair Ritchie , was an American computer scientist who "helped shape the digital era." He created the C programming language and, with long-time colleague Ken Thompson, the UNIX operating system...

 used a recursive descent parser
Recursive descent parser
A recursive descent parser is a top-down parser built from a set of mutually-recursive procedures where each such procedure usually implements one of the production rules of the grammar...

, incorporated specific knowledge about the PDP-11
PDP-11
The PDP-11 was a series of 16-bit minicomputers sold by Digital Equipment Corporation from 1970 into the 1990s, one of a succession of products in the PDP series. The PDP-11 replaced the PDP-8 in many real-time applications, although both product lines lived in parallel for more than 10 years...

, and relied on an optional machine-specific optimizer to improve the assembly language code it generated. In contrast, Johnson's pccm was based on a yacc
Yacc
The computer program yacc is a parser generator developed by Stephen C. Johnson at AT&T for the Unix operating system. The name is an acronym for "Yet Another Compiler Compiler." It generates a parser based on an analytic grammar written in a notation similar to BNF.Yacc used to be available as...

 parser generator and used a more general target machine model. Both compilers produced target-specific assembly language code which they then assembled to produce linkable object modules.

Current version

A new version of the pccm based on the original by Steve Johnson is now maintained by Anders Magnusson. The compiler is provided under the BSD licence and its development is funded by a non-profit organization called BSD Fund. According to Magnusson:
This new version was added to the NetBSD
NetBSD
NetBSD is a freely available open source version of the Berkeley Software Distribution Unix operating system. It was the second open source BSD descendant to be formally released, after 386BSD, and continues to be actively developed. The NetBSD project is primarily focused on high quality design,...

 pkgsrc
Pkgsrc
pkgsrc is a package management system for Unix-like operating systems. It was forked from the FreeBSD ports collection in 1997 as the primary package management system for NetBSD. Since then it has evolved independently: in 1999, support for Solaris was added, later followed by support for other...

 and OpenBSD
OpenBSD
OpenBSD is a Unix-like computer operating system descended from Berkeley Software Distribution , a Unix derivative developed at the University of California, Berkeley. It was forked from NetBSD by project leader Theo de Raadt in late 1995...

 source trees in September 2007, and later into the main NetBSD
NetBSD
NetBSD is a freely available open source version of the Berkeley Software Distribution Unix operating system. It was the second open source BSD descendant to be formally released, after 386BSD, and continues to be actively developed. The NetBSD project is primarily focused on high quality design,...

 source tree, and there has been some speculation that it might eventually be used to supplant the GNU C Compiler on BSD-based operating systems.
At December 29, 2009 the PCC became capable of building a functional x86 OpenBSD
OpenBSD
OpenBSD is a Unix-like computer operating system descended from Berkeley Software Distribution , a Unix derivative developed at the University of California, Berkeley. It was forked from NetBSD by project leader Theo de Raadt in late 1995...

 kernel image.

PCC version 1.0 was finally released on 1 April 2011. In the announcement sent to the project donors, Michael Dexter, BSD Fund Program Manager, said:

See also

  • Amsterdam Compiler Kit
    Amsterdam Compiler Kit
    The Amsterdam Compiler Kit is a fast, lightweight and retargetable compiler suite and toolchain written by Andrew Tanenbaum and Ceriel Jacobs, and is MINIX's native toolchain. The ACK was originally closed-source software , but in April 2003 it was released under an open source BSD license...

  • Clang
    Clang
    Clang is a compiler front end for the C, C++, Objective-C, and Objective-C++ programming languages. It uses the Low Level Virtual Machine as its back end, and Clang has been part of LLVM releases since LLVM 2.6....

  • GNU Compiler Collection
    GNU Compiler Collection
    The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain...

  • Open Watcom

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK