Cfront
   HOME

TheInfoList



OR:

Cfront was the original
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
for
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
(then known as " C with Classes") from around 1983, which converted C++ to C; developed by
Bjarne Stroustrup Bjarne Stroustrup (; ; born 30 December 1950) is a Danish computer scientist, most notable for the invention and development of the C++ programming language. As of July 2022, Stroustrup is a professor of Computer Science at Columbia University. ...
at AT&T Bell Labs. The
preprocessor In computer science, a preprocessor (or precompiler) is a 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 is often used by so ...
did not understand all of the
language Language is a structured system of communication. The structure of a language is its grammar and the free components are its vocabulary. Languages are the primary means by which humans communicate, and may be conveyed through a variety of met ...
and much of the
code In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication ...
was written via
translations Translation is the communication of the meaning of a source-language text by means of an equivalent target-language text. The English language draws a terminological distinction (which does not exist in every language) between ''transla ...
. Cfront had a complete
parser Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term ''parsing'' comes from Lati ...
, built
symbol table In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier (or symbols), constants, procedures and functions in a program's source code is associated with info ...
s, and built a
tree In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, including only woody plants with secondary growth, plants that are ...
for each
class Class or The Class may refer to: Common uses not otherwise categorized * Class (biology), a taxonomic rank * Class (knowledge representation), a collection of individuals or objects * Class (philosophy), an analytical concept used differentl ...
,
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
, etc. Cfront was based on CPre, a C compiler started in 1979. As Cfront was written in C++, it was a challenge to bootstrap on a machine without a C++ compiler/translator. Along with the Cfront C++ sources, a special "half-preprocessed" version of the C code resulting from compiling Cfront with itself was also provided. This C code was to be compiled with the native C compiler, and the resulting executable could then be used to compile the Cfront C++ sources. Most of the porting effort in getting Cfront running on a new machine was related to standard I/O. Cfront's C++ streams were closely tied in with the C library's buffered I/O streams, but there was little interaction with the rest of the C environment. The compiler could be ported to most
System V Unix System V (pronounced: "System Five") is one of the first commercial versions of the Unix operating system. It was originally developed by AT&T and first released in 1983. Four major versions of System V were released, numbered 1, 2, 3, an ...
derivatives without many changes, but
BSD The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
-based systems usually had many more variations in their C libraries and associated stdio structures. Cfront defined the language until circa 1990, and many of the more obscure corner cases in C++ were related to its C++-to-C translation approach. A few remnants of Cfront's translation method are still found in today's C++ compilers;
name mangling In compiler construction, name mangling (also called name decoration) is a technique used to solve various problems caused by the need to resolve unique names for programming entities in many modern programming languages. It provides a way of e ...
was originated by Cfront, as the relatively primitive linkers at the time did not support type information in symbols, and some template instantiation models are derived from Cfront's early efforts. C++ (and Cfront) was directly responsible for many improvements in
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
linkers and
object file An object file is a computer file containing object code, that is, machine code output of an assembler or compiler. The object code is usually relocatable, and not usually directly executable. There are various formats for object files, and the ...
format Format may refer to: Printing and visual media * Text formatting, the typesetting of text elements * Paper formats, or paper size standards * Newspaper format, the size of the paper page Computing * File format, particular way that informatio ...
s, as it was the first widely used language which required link-time type checking,
weak symbol Weak may refer to: Songs * "Weak" (AJR song), 2016 * "Weak" (Melanie C song), 2011 * "Weak" (SWV song), 1993 * "Weak" (Skunk Anansie song), 1995 * "Weak", a song by Seether from '' Seether: 2002-2013'' Television episodes * "Weak" (''Fear t ...
s, and other similar features. Cfront 4.0 was abandoned in 1993 after a failed attempt to add exception support.
Scott Meyers Scott Douglas Meyers (born April 9, 1959) is an American author and software consultant, specializing in the C++ computer programming language. He is known for his ''Effective C++'' book series. During his career, he was a frequent speaker at con ...

The Most Important C++ Software...Ever
2006
The C++ language had grown beyond its capabilities; however a compiler with similar approach became available later, namely
Comeau C/C++ Comeau C/C++ is a compiler for C and C++ produced by Comeau Computing. Comeau C/C++ was once described as the most standards-conformant C++ compiler. In 2006-2008 it was described as the only mainstream C++ compiler to fully support the export ke ...
.


References

;Notes * * *


External links


Cfront Releases
a
C++ Historical Sources Archive
C++ compilers Unix programming tools {{programming-software-stub fr:Cfront