The C Programming Language was introduced by Kernighan and Ritchie of Unix fame; it was based on the "typeless" language, BCPL .
Brad Cox introduced Objective C, layering the object model as well as some of the syntax of Smalltalk on top of C. It is quite unfortunate that this never grew to popularity, as it is an easy to understand model compared to the rather more byzantine C++.
Bjarne Stroustrup created C++, which combined the facilities of C with the "class-oriented" concepts of Simula.
GCC is by far the most commonly-used C compiler in the world of Unix; it supports many platforms surprisingly well, and indeed supports an increasing number of languages (classical C, ANSI C, C++, Objective-C, Ada, Pascal, FORTRAN, and others...)
A recent development project related to GCC was called EGCS. Its goal was to fold together a number of independent "hacks" taking place on GCC. Unfortunately, the FSF's needs for GCC were somewhat at odds with the desires of others that have done quite a bit of "hacking" on GCC over the years. As the "GNU System's Compiler," stability was paramount, and the FSF had been reluctant to add various external code to the "GCC2 Tree."
This included such things as:
FORTRAN support and various language-specific improvements for other languages;
Instruction scheduling from IBM Haifa ("generic optimizations") that would provide optimization for all platforms at the machine language level;
Alias analysis and various other optimizations that get applied at the "generic language level," thus applying to all languages and all platforms;
Improved conformance of the C++ components with the upcoming C++ standards, such as the Standard C++ Library.
EGCS was opened up as a project to try to join many of these changes together into a single "experimental" code stream, to ultimately become the "next GCC." This approach was adequately successful, and EGCS is now GCC.
We are pleased to announce a new GCC maintainer. The EGCS Steering Committee is taking over as the (collective) GNU maintainer of GCC--and changing its name to the GCC Steering Committee. The GNU maintainer of a package has the responsibility for deciding what changes to install, fixing bugs, and making releases. The development process for GCC will be essentially the same as has been used for EGCS, and the EGCS CVS archive will become the GCC CVS archive. Day-to-day technical details will be handled by the release manager (currently Jeff Law) appointed by the steering committee. We would like to thank Richard Kenner for his work as the GCC maintainer for the 2.5.x through 2.8.x releases of GCC. | ||
| -- Richard Stallman | ||
There has also been some work done on building versions that know something about the MMX extensions popularized by Intel. >
A set of GCC 3.0 Release Criteria have been released; planning is apparently ongoing for the next major version...
GCC Summit: First Annual GCC Developer's Summit - 2003 May 2003, in Ottawa , Canada.
lcc, a Retargetable Compiler for ANSI C is notable for the characteristic that it was written using noweb, a Literate Programming tool.
This compiler is considerably smaller and faster than GCC. It does not support as many platforms, and does not provide as sophisticated optimization strategies. On the other hand, it is far more approachable in source code form, and is probably a lot easier to understand.
This project was originally sponsored by the Open Software Foundation, and sought to create tools to manipulate software in ANDF - Architecture Neutral Distribution Format.
The intent was to be able to compile software in various languages including C, C++, and Ada95, producing "object code" in the ANDF format, which would then be turned into machine-specific executables on the target host.
Vendors could produce programs in ANDF form, and they should "just run" on any of the target platforms. A local installer application would transform ANDF inputs to produce target-specific forms.
The main available result of the efforts is the TenDRA C/C++ Compiler set using ANDF. Compilers for Ada95, Dylan, and possibly other languages, were created, but are not publicly available.
The ANDF approach is not unlike the way GCC uses RTL , except that with GCC, RTL is used as an internal step in the compilation process, and is not intended to be useful as a "code distribution" form. Notably, the GCC RTL form winds up being quite platform-specific, whereas ANDF is a platform-independent distribution form.
Apparently, "The project ended somewhat acrimoniously in April 1998;" for all intents and purposes, TenDRA development "died." In 2002, some interest has re-emerged.
Supported platforms have included:
AIX/PPC
HP-UX/PA-RISC
Irix/MIPS
Linux/IA-32
OSF1/Alpha
SCO/Intel
Solaris/SPARC, Solaris/IA-32, SunOS/68K
Ultrix/MIPS
Unixware/IA-32
It seems unfortunate to me that this fell so badly by the wayside; the availability of a compiler suite with a fairly substantially different model from GCC would seem likely to offer three significant merits:
It would allow more ambitious experimentation to take place without substantially increasing the risks associated with failure;
The fact of having a different architecture implies that different improvements might take place; improvements that might be inconvenient to implement with GCC might be easier to add to a different compiler;
Having substantially different compilers in use encourages conformance with actual standards, and discourages people from writing code that merely, conveniently, happens to work with GCC.
For instance, the Linux kernel is exceedingly dependent on GCC, indeed, it tends only to compile successfully when GCC versions are selected fairly carefully. In a sense, Linux thus isn't "written in C;" it is written in the "GCC dialect of C."
The problem with that is that if GCC is modified to improve optimization of code, this occasionally breaks code that depends on GCC generating code in a particular way. In effect, this discourages improvements to GCC; if Linux was also compilable with TenDRA, that issue would be somewhat relieved...
Sybase has decided to release the Watcom C and FORTRAN compilers as free software.
Thus far, the main targets are Win32, OS/2, and MS-DOS; we'll see if it becomes of wider interest...
Amsterdam Compiler Kit (ACK) Information Sheet
The Amsterdam Compiler Kit is an integrated collection of programs designed to simplify the task of producing portable (cross) compilers and interpreters. For each language to be compiled, a program (called a front end) must be written to translate the source program into a common intermediate code. This intermediate code can be optimized and then either directly interpreted or translated to the assembly language of the desired target machine.
The current version contains front-ends for Modula-2, C, ANSI C, Fortran, Pascal, Basic, and occam, and back-ends for a.o. DEC PDP-11, DEC VAX, Motorola 68000, Motorola M68020, SPARC, Intel 8080, Intel 8086, Intel 80386, Zilog Z80, Zilog Z8000, NS 16032. Also included are a parser generator called LLgen, a code-generator-generator (the code-generators are table-driven), a peephole optimizer on the intermediate code, a global optimizer on the intermediate code, table-driven machine-dependent peephole optimizers, and many other utilities.
This compiler kit was notably used to implement Minix. Richard Stallman asked if it could be made available to the GNU Project as their C compiler; when Tanembaum declined, work proceeded on GCC.
Mix Software has been selling some seriously inexpensive C tools for CP/M and MS-DOS for many moons. $50 buys you compiler, a database library (ISAM), a character-based GUI library, as well as a small POSIX-like realtime multitasking kernel that runs atop MS-DOS.
It's not fancy, but it's tiny, running on hardware that couldn't support GCC...
CIL - Infrastructure for C Program Analysis and Transformation
CIL compiles valid C programs into a small set of core constructs. It is apparently able to process the Linux kernel , complete with GCC extensions.
The point of it is to transform C code into a sort of "lowest-common-denominator" form that would be amenable to further processing.
Implemented using OCAML .
BDS C, the original CP/M C
There is the theory that C is a "compiled" language; this isn't exclusively true, as various C interpreters exist...
Ch -- an embeddable C/C++ interpreter, compiler for numerical computing
A debugger that includes a C interpreter
My goal was to write the smallest C compiler which is able to compile itself. I choose a subset of C which was general enough to write a small C compiler. Then I extended the C subset until I reached the maximum size authorized by the contest: 2048 bytes of C source excluding the ';', '{', '}' and space characters.
An optimizing C compiler that is IA-32-specific, but which is tiny in size, and runs quick on IA-32 Linux systems.
LCLint is a program that analyzes C source files and reports non-portable or error-prone situations. It can be configured at a very fine-grained level so you can select the types of errors/warnings to generate.
If you annotate your source code with comments indicating information about the flow of control/data, it can perform additional checks to find dangerous data accesses and incorrect program logic that cannot be found by a traditional lint.
Splint is a tool for statically checking C programs for security vulnerabilities and coding mistakes. With minimal effort, Splint can be used as a better lint. If additional effort is invested adding annotations to programs, Splint can perform stronger checking than can be done by any standard lint.
The Top 10 Ways to get screwed by the C programming language
An easy to use memory profiling and malloc debugging library for C and C++ programs. It can finds leaks, multiple deallocations, and memory corruptions.
Boehm Memory Manager, providing a conservative garbage-collector to automate the allocation and deallocation of memory.
CCIDE - Decision Table Code Generator
Reads a file containing an embedded decision table along with C code to support this, and generates C code to implement the table.
GCC AST Tree_Node Project with PostgreSQL Interface
CCured is a source-to-source translator for C. It analyzes the C program to determine the smallest number of run-time checks that must be inserted in the program to prevent all memory safety violations. The resulting program is memory safe, meaning that it will stop rather than overrun a buffer or scribble over memory that it shouldn't touch. Many programs can be made memory-safe this way while losing only 10--60% run-time performance (the performance cost is smaller for cleaner programs, and can be improved further by holding CCured's hand on the parts of the program that it does not understand by itself). Using CCured we have found bugs that Purify misses with an order of magnitude smaller run-time cost.
A program that examines source code and reports possible security weaknesses ("flaws") sorted by risk level.
FACT! - (Functional Additions to C++ through Templates and Classes)
vtable - virtual function dispatch table.
Per G++ Dialect Options documentation:
The traditional (cfront-style) approach to implementing vtables was to store a pointer to the function and two offsets for adjusting the `this' pointer at the call site.
Newer implementations store a single pointer to a `thunk' function which does any necessary adjustment and then calls the target function.
Per Grinding Java :
ActiveX: DCOM was based on COM which was based on an idea derived from C++: the vtables. In C++, every class which contains a virtual function (a function that may be overridden by a subclass) has a vtable which has an entry for every virtual function in the class. The vtable contains pointers to the functions in the correct subclass so when a method is invoked the vtable will send the call to the correct method.
Per: About DOM and CORBA, an article by Jeff Greif:
The C++ objects produced by different compilers are, by explicit design, incompatible (see, for instance, the chapter on linkage in the Stroustrup and Ellis ARM from 1990.) The layout of the objects is almost entirely up to the implementation, as are the placement (or use of) vtables, and the runtime type information. Each compiler uses a different name mangling scheme (by explicit design) so your link will fail if you try to mix code produced by different compilers! (If this didn't happen, the incompatibilities would cause various mysterious failures at runtime.) Binary compatibility even on a single platform is not part of the picture.
Just in case I haven't made myself clear enough, suppose you buy the HighSpeedDOM dll which was written in C++ and compiled using compiler X. Now you get the DOM.h file which defines the classes and methods according to the new C++ DOM mapping. You include this in your C++ client code, compile your client code, which instantiates a DOM object and calls some of these methods, using compiler Y. When you try to link against HighSpeed's DLL, it will fail simply because the names of the methods in your compiled code and in HighSpeed's code don't agree.
If by some dreadful accident, compiler X and compiler Y have chosen the same name mangling scheme, then the program will fail at runtime, calling the wrong method with the wrong arguments or looking in the wrong slot of the object for a data value, and probably memory will be corrupted.
A company trying to produce a terrific DOM implementation in binary form must compile it with each supported compiler.
Another issue, related to name mangling, is incompatibility between compilers. The name mangling is not standardized, and thus each compiler decorates functions differently. A DLL compiled by one compiler cannot be used by another. If you did not want to give away your source code, you would have to provide all the compiled versions yourself. Using this technique in a component software scenario is simply not acceptable. There would have to be many objects with the same functionality to satisfy all possible clients.
There are several problems in deploying C++ programs widely. It suffers from having to support function overloading, typesafe linkage and namespace and class scopes, which are difficult to retrofit over top of traditional object file formats.
Unfortunately, there is, as of yet, no convention for representing these things atop object formats such as ELF.
Providing an initiative to normalize methods and conventions for OOA/OOD/C++ development for Linux, materialized in documentation, OO analysis and design models, and a set of Open Source C++ class libraries (libcorelinux++ and libcoreframework++) to support common patterns and exploit the C++ standards.
It offers a comprehensive C++ class library that includes the Gang of Four Design Patterns.
STLport: An Interview with A. Stepanov
The author of the STL template programming system for C++ indicates that STL is not object oriented, and thinks that "object orientedness is almost as much of a hoax as Artificial Intelligence."
A gallery of broken C++ programs, with hints and answers.
Objective C was designed by Brad Cox, and adds object-oriented "extensions" to C. It is considered to be simpler to learn than C++. Objective C is the language used to implement NeXTStep, and is the "language of choice" for use with OpenStep and GNUStep.
GCC has a "front end" for Objective C that was developed by NeXT.
Another description is that Objective-C is a cross between Smalltalk and C. As a true superset of C it is ideal for putting object wrappers on existing C libraries.
Portable Object Compiler at SourceForge
The Portable Object Compiler consists of a set of Objective C class libraries and a precompiler (translator) that generates plain C code.
Portable Object Compiler (Objective C equivalent to C++'s CFRONT)
Translator that turns Objective C code into ANSI C.
An Introduction to Object-Oriented Programming - A fairly recent guide to Objective C
Objective C Development Tools for Linux: /Linux/sunsite/devel/lang/objc/
Black Shoals - Stock Market Planetarium...
Implemented in Objective C using MacOS-X
This document describes a number of optimizations that have proved useful to substantially improve the performance of Mac OS-X programs. In theory, the techniques might also be meaningful for GNUStep , although some comparisons have been done that indicate that GNUStep has a different set of bottlenecks so that the techniques have little effect there.
netclasses is an interface for creating
TCP/IP-based servers in Objective C.
The TOM Programming Language is an object-oriented programming language that advocates unplanned reuse of code.
According to the FAQ, TOM resembles Objective-C, syntactically, whilst being somewhat more dynamic.
This language adds quite a number of abstractions not found (at least not within the language definition) in C or C++, including garbage collection, associative arrays; see D vs Other Languages for more details...
Before C, there was BCPL.
BCPL is a simple typeless language that was designed in 1966 by Martin Richards and implemented for the first time at MIT in the Spring of 1967.
C was based on the B language, which was based on BCPL.
MCPL is a simple typeless language which is based on BCPL. It makes extensive use of pattern matching somewhat related to that used in ML and Prolog, and some other features come from C.
T3X is intended as a "minimal" procedural language. It looks a lot like a cross between Algol and C, and consciously inherits a great deal from from BCPL , notably a quasi-typeless variable system. The design goals are thus:
Simple syntax and semantics
High portability
Simple self-hosting implementation
Suitability to both interpretation and generating native code
One of the creators of C and Unix...
A C-like language designed for multithreading
Simple Pipe example
Or alternatively:Design and Implementation of the GNU INSEL Compiler gic
Info on building a GCC front end
Cilk adds some parallelism keywords to ANSI C
Which wants to be a "better Object Oriented C than C++." It borrows generic functions and real macros from Lisp , and is intended to be readily mappable onto C, perhaps via a GCC front end.