Talk:Cfront
![]() | This article is rated Stub-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||
|
Cfront isn't a language
[edit]No, no, no.
Cfront isn't a language. Cfront was (still is?) a C++ compiler. It was implemented as a pre-processor that converted C++ to C. It was written in C++. (unsigned comment by 137.205.8.4)
- Feel free to dive in and corrent the article itself, anonymous visitor :-) -- Tarquin 11:38 Jan 22, 2003 (UTC)
Cfront did not compile to "C with classes"
[edit]The "C with classes" compiler was called Cpre (page 4 of http://www.research.att.com/~bs/hopl2.pdf ). Page 36 of that same PDF includes C++'s population growth, and the 1983 and 1984 numbers don't include people using Cpre.
The current first sentence of the article ("Cfront was the original compiler for C++ (then known as 'C with Classes') from around 1983, which converted C++ to C; developed by Bjarne Stroustrup.") is therefore wrong. It should be something like "Cfront was the original compiler for C++, released in 1983 and developed by Bjarne Stroustrup. Cfront replaced a simpler preprocessor -- Cpre -- which worked on a languages called "C with Classes". Cfront was written in C with Classes, was a traditional multi-pass compiler and output C code which was then compiled with the target system's native C compiler." 12.146.21.162 (talk) 18:08, 25 September 2008 (UTC)
- Yeah, but remember, the standard for WP is "verifiability, not truth"..
- To the point that (at least.. hypothetically I suppose, maybe) truth might not matter, as long as something could be "verified" (??!! what ??) No, that doesn't really make sense to me either. This sarcastic remark comes from my reading of the Talk:Karoline_Leach#Objectivity.2FTone page about Karoline Leach, and whatever it is she has to say or not said regarding Lewis Carroll and the "Carroll Myth" - the page doesn't actually say anything about what she says regarding this "Myth", nor even give a single-sentence description of what it actually is for someone who doesn't already know. But comments are welcome here :) )
- But, to paraphrase someone else that Talk page (or maybe it was another one I looked at), "I don't do edit wars". Jimw338 (talk) 22:34, 19 December 2013 (UTC)
written in C++?!
[edit]I doubt Cfront was written in C++. How would it have been compiled? (unsigned comment by 164.107.199.102)
- gcc is written in C and compiles itself. Similarly, it is entirely possible that Cfront bootstraps itself. --Yamla 16:31, 2005 Mar 30 (UTC)
- The article claims it was the first C++ compiler therefore if it was initially written in C++ it could not have been compiled. I'd guess the very first versions were written in C and then changed to C++ as soon as cfront became usable. Plugwash 00:08, 18 September 2005 (UTC)
- cfront was written in an early dialect of C++. Versions 1 and 2 used single dots for the "::", for instance; and the operator notation for typecasting was only sporadically used in version 1, as opposed to version 2. Versions 1, 2, 3 all used the old scoping rule for for-loops. Version 3 can compile -- with a few fixups -- in g++ if you use the compiler's option to control for-loop scoping. All the versions may be found on Paul McJones' archive site [1]; the code for version 1 (which is not self-contained) I transcribed from its printouts. All three versions use a "scratch" directory where ready-made C code can be found or deposited into for a first "bootstrap" run; particularly useful when cross-compiling. All of this happened early on before a clear-cut distinction between C and C++ had been made in the minds of the latter's developers. So the C++ version uses the ".c" suffix (instead of ".C" or ".cc") and the "scratch" C version uses "..c" and "..h". If you try to compile straight out of the box; you're going to run into library conflicts; since the old C code [both used AND generated] is pre-ANSI as are library functions like malloc() and free()! This should be compared to the routine for gcc. Even if you have a gcc version in place and you're bumping up from (say) version 4 to 6 it's STILL going to end up doing a bootstrap compile with THREE separate compiling runs! On my machine it was about 100 minutes each and 1.0-1.5 GB workspace for each. — Preceding unsigned comment added by 204.128.235.10 (talk) 21:15, 31 October 2016 (UTC)
- Actually, "Version 1" alluded to above is Release E, from 1985 February, that existed only in printout form until 2016, and was the first external release of the translator. The printout is clipped, while the transcribed version restored most of what was clipped. "Version 2" is Release 1.0, and was the first commercial release, from 1985 October, and includes translated C code in the "scratch" directory to use for bootstrapping. Later releases would have to be compiled from each preceding release, afterwards. As mentioned above, Release 1.0 does indeed compile, while Release E will require reverse-patching from and cannibalization of Release 1.0 to compile, and may require the Release 1.0 cfront to compile it, since it doesn't have any of the C-translated files.
As I understand, a super simple preprocessor converted the first c++ into c. CFront was then written using that preprocessor.70.71.145.81 04:52, 14 September 2006 (UTC)
- Wait, then why not just use the original simple preprocessor, rather than write cfront? lol Family Guy Guy (talk) 01:55, 13 January 2008 (UTC)
- I suspect the simple preprocessor only supported a subset of c++ Plugwash (talk) 01:28, 15 January 2008 (UTC)
The cfront compiler commonly available in 1991 was written in C, and the source code was freely available for download. It was promoted as an interim solution until the arrival of native C++ compilers, which always seemed to be delayed for one reason or another. There may have been multiple versions of cfront. In contrast to some statements in the article, I recall that there was no widely reputable and reliable native C++ compiler until 1992 or 1993 (but that may only have been the understanding in my little corner of the world). I recall that SGI came out with a decent native compiler for their MIPS machines in about 1993, as did others, and all of them went through bug-fixing updates for awhile.
Problems related to name mangling were an ongoing source of aggravation, and objectionable oddities were constantly popping up (for example, it was discovered that data was stored in C "struct", which meant that the data location was discoverable and the data accessible outside of its class, a problem that was fixed in a later update).
The cfront commonly used in academia and non-commercial research may have been given to the public domain (meaning that anyone could do anything to it and call it their own). A cfront was offered to our group in 1992, with heavy promotion. A comparison with our own version, using a "diff" on every file, showed that the only difference was a comment statement inserted into one of the files of the promoted version.
24.178.228.14 (talk) 16:59, 4 February 2008 (UTC)
The article currently contains a link to Stroustrup's FAQ which includes the statement "The first C++ compiler (Cfront) was written in C++. To build that, I first used C to write a 'C with Classes'-to-C preprocessor. 'C with Classes' was a C dialect that became the immediate ancestor to C++. That preprocessor translated 'C with Classes' constructs (such as classes and constructors) into C. It was a traditional preprocessor that didn't understand all of the language, left most of the type checking for the C compiler to do, and translated individual constructs without complete knowledge. I then wrote the first version of Cfront in 'C with Classes'." 12.146.21.162 (talk) 17:58, 25 September 2008 (UTC)
Availibility
[edit]Is cfront freely available on the net? (unsigned comment by 64.40.48.243)
- Yes. See the cfront#External links section of this article. --DavidCary (talk) 23:43, 2 August 2023 (UTC)
the first widely-used language which required link-time type checking
[edit]...if you exclude pascal and all other languages which required link-time type checking...150.101.166.15 (talk) 05:44, 8 February 2008 (UTC)
Contradiction
[edit]"...the relative complexity of Standard C++ mandates a compiler capable of understanding the entire language rather than just the C++-specific constructs" as most of the paragraph is out of place. In the beginning it is mentioned that Cfront had a complete C++ parser, so in what way shouldn't it be unable to understand non-C++-specific (i.e. C subset) constructs?
Just before it there is a passage about Cfronts approach being unappropriate ("it is unlikely a similar translation effort would be 100% successful with the modern C++ standard"), which is obviously wrong. --138.246.7.170 (talk) 09:04, 22 September 2008 (UTC)
Challenge to bootstrap due to dependency on C++?
[edit]This is a completely stupid statement. Since cfront translated C++ to C, a distribution of Cfront merely has to include the C translation. Bootstrapping is then done with a C compiler.
Doh. —Preceding unsigned comment added by 70.79.96.174 (talk) 21:17, 27 January 2010 (UTC)
Start a discussion about improving the Cfront page
Talk pages are where people discuss how to make content on Wikipedia the best that it can be. You can use this page to start a discussion with others about how to improve the "Cfront" page.