From: | ed_davis2@yahoo.com (Ed Davis) |
Newsgroups: | comp.compilers |
Date: | 21 Jan 2003 00:04:05 -0500 |
Organization: | http://groups.google.com/ |
References: | 03-01-013 |
Keywords: | practice |
Posted-Date: | 21 Jan 2003 00:04:05 EST |
merosonox <merosonox@yahoo.com> wrote in message news:03-01-013...
> Other than Smalltalk, Lisp, Forth and ahem Intercal what is the most
> simple programming language to create a ((relatively) useful) compiler
> for?
From simplest to most complex:
Wirth's PL/0, Chung and Yuens Tiny Pascal, Gibsons Tiny-C,
Cains Small-C, Wirths Oberon-0, van de Snepschuets version
of Pascal-S.
PL/0 is about as simple as you can get, in an imperative language, but
it does have (parameterless) subroutines and local variables. P-Code
versions can be implemented in about 500 lines of C.
Tiny Pascal - basically, PL/0 with arrays and parameters, simple I/O,
in about 600 lines of C. Note that the Tiny Pascal version of Tiny
Pascal is self-compiling.
A P-Code version of Small-C (integers, chars, simple pointers and
arrays) including interpreter can be implemented in less than 1000
lines of (Small) C. It also is self-compiling.
Pascal-S, with I/O, integers, chars, and bools, arrays and records,
can be implemented in about 1500 lines of C, complete with the P-Code
interpreter.
> Which of these do you like the most?
Small-C.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.