|WikiProject Computing / Software||(Rated Stub-class)|
Cfront isn't a language
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 184.108.40.206)
- 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"
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." 220.127.116.11 (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 :) )
written in C++?!
I doubt Cfront was written in C++. How would it have been compiled? (unsigned comment by 18.104.22.168)
- 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 ; 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 22.214.171.124 (talk) 21:15, 31 October 2016 (UTC)
As I understand, a super simple preprocessor converted the first c++ into c. CFront was then written using that preprocessor.126.96.36.199 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)
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.
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'." 188.8.131.52 (talk) 17:58, 25 September 2008 (UTC)
Is cfront freely available on the net? (unsigned comment by 184.108.40.206)
"...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. --220.127.116.11 (talk) 09:04, 22 September 2008 (UTC)
Challenge to bootstrap due to dependency on C++?
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.