Related articles |
---|
Re: PL/MIX usenet@rwaltman.net (Roberto Waltman) (2007-02-07) |
Re: PL/MIX max@gustavus.edu (Max Hailperin) (2007-02-08) |
Re: PL/MIX ara@nestle.csail.mit.edu (Allan Adler) (2007-02-08) |
Re: PL/MIX usenet@rwaltman.net (Roberto Waltman) (2007-02-08) |
Re: PL/MIX gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-02-08) |
Re: PL/MIX sdn@svpal.org (Steven Nichols) (2007-02-09) |
Re: PL/MIX ara@nestle.csail.mit.edu (Allan Adler) (2007-02-09) |
[6 later articles] |
From: | Roberto Waltman <usenet@rwaltman.net> |
Newsgroups: | comp.programming,comp.compilers |
Date: | 7 Feb 2007 22:38:36 -0500 |
Organization: | Compilers Central |
References: | <y93hctzf4wz.fsf@nestle.csail.mit.edu> |
Keywords: | design |
Posted-Date: | 07 Feb 2007 22:38:36 EST |
Allan Adler wrote:
>In his Art of Computer Programming (2d ed, 1973), vol.1, p.152, Knuth writes:
>"Actually MIX has two assembly languages: MIXAL, the machine-oriented
>language which is designed to facilitate one-pass translation by a
>relatively short assembly program, and PL/MIX, which more adequately
>reflects data and control structures and which looks rather like the Remarks
>field of MIXAL programs. PL/MIX will be described in Chapter 9."
>
>I'm aware that Knuth's current efforts on extending the first 3 volumes
>are based on a different computer model (MMIX instead of MIX), but let's
>forget about that and remain in the context of Knuth's original plan for
>the work. From the name, PL/MIX sounds as though it should be a variant
>of PL/I implemented on the MIX machine. I don't know much about PL/I but
>my impression is that it is a compiled language. At any rate, there are
>compilers for it. On the other hand, Knuth's plan was for Chapter 9 to
>deal with Lexical Scanning. Compilers weren't supposed to appear until
>Chapter 12. So, it sounds as though Knuth really intended his PL/MIX to
>be a kind of assembly language which could be adequately processed with
>just lexical analysis.
>
>Since I know so little about PL/I, I'm just wondering whether this
>description of PL/MIX does sound like a variant of PL/I and, if so,
>whether there is some free source code available for processing PL/I
>programs along the lines that Knuth seems to be indicating for PL/MIX.
>
>Also, suppose one knows the architecture of a certain computer and
>one has an assembly language for that computer (such as Knuth's MIXAL
>for MIX) and one wants to produce an analogue of PL/I (assuming that
>PL/MIX really is such an analogue) for that architecture which resembles
>Knuth's description of more adequately reflecting data and control structures
>resembling the Remarks field of the assembly language programs. How does
>one go about producing such a variant? I get the impression from Knuth's
>book that this is (or was) a standard activity that must have been done
>on a lot of architectures.
Indeed. Adding "structured programming" control structures to a
language is a simple exercise that has been repeated many times, using
macros, (for assemblers with adequate macro facilities,) or with
simple preprocessors for either assembly or higher level languages.
Adding complex data structures may be more difficult because it may
both require greater syntactic changes to the base language, and may
require more complex analysis and greater understanding of the base
language (by the preprocessor, adding control structures requires
almost none.) It is still something relatively easy to do.
On the other end of the simplicity spectrum, Objective-C, C++ and
others have been implemented as preprocessors to C.
>So, maybe some of them are sufficiently well
>documented that someone working on a modern PC running Linux can still
>learn something from reading about them. If you can point me to relevant
>examples, I would appreciate it. I'm not trying to implement a version of
>PL/I on my PC. I'm interested in seeing something like the PL/MIX that Knuth
>originally promised, even if he has abandoned it and even if I have to do it
>myself.
Look at the Ratfor sources (Kernighan & Plauger's "Software Tools")
for a simple example, David Stes's "Portable Object Compiler" for a
more complex one.
> I have a MIX simulator (for the original MIX, that works, as well as
>one for MMIX that I haven't tried out yet), and I do hope that this PL/MIX
>will run on it. I just need to know enough about the general idea to be
>able to improvise with some confidence.
The group comp.compilers may be a better place for this question. I'm
cross-posting this reply there. (And that's why I'm also leaving the
original post in full.)
Roberto Waltman
[Assemblers with high level syntax have been around for a long time.
In 1966 Wirth wrote the classic PL360, an IBM 360 assembler with Algol
syntax, as the implementation languge for Algol W. It was in use for
a long time -- in 1988 someone wrote to comp.compilers hoping to find
a PL360 to C translator to translate a whole lot of PL360 code he was
in charge of. Later in the 1970s PL/M was a hacked down version of
PL/I with extra stuff added to make it an assmbler substitute
originally for the 8080, and later for the 8086, 286, and 386. Also
look for Bell Labs' lil, a low level implementation language that was
abandoned when they discovered that C could do everything it could
do. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.