[Home]Compiler/Talk

HomePage | Compiler | Recent Changes | Preferences

I changed "source code" to "source language" because a compiler can be pretty anything that translates a language to another one. This includes a lot of translations which are not source code, such as binary-to-binary translations and just-in-time compilation processes. "Source code" in its normal meaning refers to a list of instructions in a language understandable to humans. Source language can be anything that can be griped by formal language definitions (and that is pretty much anything).

---

original Compilers page

Compilers - Tools for creating machine-readable programs

A compiler is a software programs which takes as its input a set of modules written in a ProgrammingLanguage and creates a machine readable binary executable image file.

Computer hardware can only understand very specific binary machine language instructions. Each instruction must be written in an extremely precise format and must conform to extremely limited abilities of the computer's CPU (Central Processing Unit). Such binary machine language is too cumbersome for humans to read, write, and understand directly.

Compilers have the ability to understand the more abstract, symbolic, human-friendly programming languages and to generate a low level binary machine language program which executes *exactly* what the programming language specifies.



original Talk page

Right, I forgot about that. Most of my experience programming was in the mid-80s, tinkering around with BASIC. Not exactly a powerhouse language. :-D


Compilers do not always take source code and output executable machine code. The program may have to be processed by a linkage editor and/or loader program first.


... Steve Gibson (http://grc.com/) releases his programs in machine language. Not sure how he does it... If he actually writes in it or what. I would imagine not but haven't asked. I suppose it's possible, though that would probably make him a certifiable genius. :-D

Yes he writes in assembler. See [How to write Windows programs in assembler]. There is even an link to a free assembler for 386 Intel processors and beyond (486, Pentium etc.).

It would be nice to have an assembler entry with some example programs.


The article makes a distinction between compiled and interpreted languages. While most languages are either primarily interpreted, or primarily compiled, any language that can be compiled can be interpreted, and (modulo eval statements and the like) any language that can be interpreted can be compiled. In practice, there are compilers for normally-interpreted languages such as Perl (which is compiled to bytecode anyway), LISP, and Prolog, and interpreters for such commonly-compiled languages as C and C++. -- Robert Merkel


The original definition of compiler is not necessarily bound to generation of executeable/object code. The general definition in the dragon book (which would worth a mention on its own on the compiler main page) goes roughly as "a compiler reads a program written in one language - the source language - and translates it into an equivalent program written in another language - the target language". Also a rough lineup of the history of compiler development, maybe split from "first FORTRAN compiler to dragon book" and "dragon book until now" would be nice. -- scut


HomePage | Compiler | Recent Changes | Preferences
This page is read-only | View other revisions
Last edited December 13, 2001 2:14 am by 213.20.128.xxx (diff)
Search: