On 17/11/12 8:49 PM, Huw Davies wrote:
On 18/11/2012, at 12:07 PM, Toby Thain<toby at telegraphics.com.au> wrote:
On 17/11/12 7:43 PM, Fred Cisin wrote:
On Sat, 17 Nov 2012, Toby Thain wrote:
Most modern language compilers are written in
their own language, actually.
While it is a common exercise in "proofing" a compiler,
it would have made sense only if that particular language was best
suited for compiler writing, rather than any other language specialty :-)
Nonetheless, it is the usual route.
From the days when I studied and wrote compilers
(which very much makes this on-topic :-)) I can recall that the following languages are
compiled by compilers written in themselves:
BLISS-10
BCPL
Pascal
c
ALGOL-60 (at least one reference implementation)
SAIL
Other languages were written in something 'more efficient', for example, ALGOL-60
for TOPS-10 is written in MACRO-10 macros which were an attempt to give a high-level
structure to a very large MACRO program.
There are other languages I studied but can't remember what they're written in -
SIMULA-67, SNOBOL, FORTRAN, ALGOL-W, ALGOL-68, Modula-2 - I suspect some of these are
written in themselves but I suspect many of them are assembler programs.
These days c seems to be the favoured implementation language, hence Ruby, Python, Icon
etc are all c programs (although there is a version of Python written in itself).
C is more common for *interpreters*, but adding to your list above -
modern *compilers* in their own language include Java, Haskell (GHC &
Hugs), Scala, Python & PyPy, Mercury, Schemes, many Lisps, Factor,
Standard ML, Mythryl, Perl 6 (& NQP), Rust, many Forths, clang, D, and
many others.
As I say: The normal route, a not insignificant reason being that C is
pointlessly painful to write high level code in.
--Toby
Huw Davies | e-mail: Huw.Davies at kerberos.davies.net.au
Melbourne | "If soccer was meant to be played in the
Australia | air, the sky would be painted green"