Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Cfront
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Original compiler for C++}} '''Cfront''' was the original [[compiler]] for [[C++]] (then known as "[[C (programming language)|C]] with Classes") from around 1983, which converted C++ to C; developed by [[Bjarne Stroustrup]] at AT&T Bell Labs. The [[preprocessor]] did not understand all of the [[programming language|language]] and much of the [[source code|code]] was written via [[Source-to-source compiler|translations]]. Cfront had a complete [[parser]], built [[symbol table]]s, and built a [[tree data structure|tree]] for each [[class (computer science)|class]], [[function (programming)|function]], etc. Cfront was based on CPre, a C compiler started in 1979. As Cfront was written in C++, it was a challenge to [[bootstrapping (compilers)|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]] derivatives without many changes, but [[BSD]]-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]] was originated by Cfront, as the relatively primitive [[Linker (computing)|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]] linkers and [[object file]] [[file format|format]]s, as it was the first widely used language which required link-time type checking, [[weak symbol]]s, and other similar features. Cfront 4.0 was abandoned in 1993 after a failed attempt to add [[exception handling|exception]] support.<ref>[[Scott Meyers]], [http://www.artima.com/cppsource/top_cpp_software.html The Most Important C++ Software...Ever], 2006</ref> The C++ language had grown beyond its capabilities; however a compiler with similar approach became available later, namely [[Comeau C/C++]]. Analogous to the way cfront can process C++ source code into something that can be compiled by previously-available C compilers, '''cppfront''' processes source code written in new and experimental C++ 'syntax 2' into something that can be compiled by previously-available 'syntax 1' C++ compilers.<ref> [https://www.google.com/books/edition/Professional_C++/lSabEAAAQBAJ "Professional C++ Philosophy and Principles"]. 2022. p. 373. </ref><ref> Paul Krill. [https://www.infoworld.com/article/3674213/cppfront-project-aims-to-modernize-c.html "Cppfront project aims to modernize C++"]. InfoWorld. </ref> '''cppfront''' is different in scope in that it doesn't perform many validity checks on the code, instead relying on the C++ compiler for any checks that would require non-local understanding of the code such as establishing correct use of [[Symbol table|symbols]]. Cfront on the other hand was a complete compiler that just happened to target the C language instead of an [[Assembly language|assembler]]. == References == {{reflist}} ;Notes * {{cite web | url=http://stroustrup.com/hopl-almost-final.pdf | title=Evolving a language in and for the real world: C++ 1991-2006 | author=Bjarne Stroustrup | archive-url=https://web.archive.org/web/20071120015600/http://www.research.att.com/~bs/hopl-almost-final.pdf | archive-date=2007-11-20 }} * {{cite web | url=http://stroustrup.com/bs_faq.html#bootstrapping | title=Bjarne Stroustrup's FAQ | author=Bjarne Stroustrup }} * {{cite web | url=http://stroustrup.com/dne.html | title=The Design and Evolution of C++ | author=Bjarne Stroustrup }} == External links == * [http://www.softwarepreservation.org/projects/c_plus_plus/index.html#cfront Cfront Releases] at [http://www.softwarepreservation.org/projects/c_plus_plus C++ Historical Sources Archive] * [https://github.com/seyko2/cfront-3 cfront v3], the cfront re-port for the 4th edition of [[Plan 9 from Bell Labs]] * [https://github.com/farisawan-2000/cfront-3 Cfront 3.0.3], "AT&T/Bell Labs C++ to C translator from 1994, modified to build on modern hardware" [[Category:C++ compilers]] [[Category:Unix programming tools]] [[fr:Cfront]]
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Cite web
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Search
Search
Editing
Cfront
Add topic