A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses. Typically, a programmer writes language statements in a language such as Pascal, C or Java one line at a time using an editor. If the compiler finds no errors in the code, it produces a file that the computer can run- this is not human readable but easy to read by the machines.
People were writing programs in high level languages well before the 1950s and Konrad Zuse is the forgotten pioneer from the 1940s. What is the distinction between a compiler and an assembler? Some early ‘high-level’ languages look distinctly low-level from our much later perspective; some assemblers support fancy subroutine and macro facilities that give them a high-level feel.
Glennie’s Autocode is from 1952 and depending on where the compiler/assembler line is drawn might be considered a contender for the first compiler. The team led by Grace Hopper produced A-0, a fancy link-loaded, in 1952; they called it a compiler, but today we would not consider it to be one. Fortran and Cobol hog the limelight of early compiler history. Work on the first Fortran compiler started in the summer of 1954 and was completed 2.5 years later, say the beginning of 1957. A very solid claim to being the first compiler (assuming Autocode and A-0 are not considered to be compilers).
Compilers were created for Algol 58 in 1958 (a long dead language implemented in Germany with the war still fresh in people’s minds; not a recipe for wide publicity) and 1960 (perhaps the first one-man-band implemented compiler; written by Knuth, an American, but still a long dead language). The 1958 implementation sounds like it has a good claim to being the second compiler after the Fortran compiler. In December 1960 there were at least two Cobol compilers in existence.
the C compilation process
You can see that compilation is not a single step, but a series of steps. This will become clearer when we play with the online IDE. The GCC (GNU Compiler Collection) is a compiler supporting various programming languages, hardware architectures and operating systems. The Free Software Foundation distributes GCC as free software under the GNU General Public License. If we say
gcc main.c -lm
this means that we pass the c program main.c to the gcc compiler, and add a note to link the library called math (lm) as well. The -command is known as a flag or switch- it is an additional argument that the program being called understands as "do this thing as well".
A Java compiler is a compiler for the programming language Java. The most common form of output from a Java compiler is Java class files containing platform-neutral Java bytecode, but there are also compilers that output optimised native machine code for a particular hardware/operating system combination, most notably the now discontinued GNU Compiler for Java.