Re: PL/MIX

Roberto Waltman <usenet@rwaltman.net>
8 Feb 2007 16:56:56 -0500

          From comp.compilers

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)
Re: PL/MIX ara@nestle.csail.mit.edu (Allan Adler) (2007-02-11)
Re: PL/MIX ArarghMail702@Arargh.com (2007-02-12)
Re: PL/MIX Peter_Flass@Yahoo.com (Peter Flass) (2007-02-12)
[3 later articles]
| List of all articles for this month |
From: Roberto Waltman <usenet@rwaltman.net>
Newsgroups: comp.compilers
Date: 8 Feb 2007 16:56:56 -0500
Organization: Compilers Central
References: <y93hctzf4wz.fsf@nestle.csail.mit.edu> 07-02-018 07-02-025
Keywords: assembler
Posted-Date: 08 Feb 2007 16:56:56 EST

Allan Adler wrote:
>Roberto Waltman <usenet@rwaltman.net> writes:
>
>> 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.
>
>Since it is an exercise, is there perhaps a concise statement of that
>exercise as an explicit exercise in some programming text? Preferably
>something like, "Take the fake assembly language we defined in section
>2 and enhance it with 'structured programming' control structures. For
>example, add the following constructions and capabilities: ... "?


I personally did it three or four times for assemblers (PDP MACRO-11,
Z80, IAR 68HC11) and once for BASIC. (MicroBee Basic) Don't have the
sources any more, and the idiosyncrasies of the macro languages may
make them difficult to understand. (The IAR version in particular.)


Ratfor (Rational Fortran) is probably a better starting point,
specially the Ratfor in Ratfor version. (Even if you are not familiar
with Fortran.) A quick search for the basic methodology in Ratfor
found these:


    * Ratfor: A preprocessor for rational Fortran
    http://striky.ece.jhu.edu/~sasha/SOFTWARE/FORTRAN90/ratfor.pdf
    http://wolfram.schneider.org/bsd/7thEdManVol2/


    Not Ratfor, but same ideas:
    * An Algorithm for Structuring Programs:


http://delivery.acm.org/10.1145/820000/811545/p113-baker.pdf?key1=811545&key2=4550690711&coll=&dl=ACM&CFID=15151515&CFTOKEN=6184618


    For Ratfor (Rational FORTRAN) in Ratfor:


http://www.aw-bc.com/catalog/academic/product/0,1144,020103669X,00.html
    (Avoid the PASCAL version of the book)


(Or download the Ratfor sources from any Linux/FreeBSD etc.
repository.)


There were other similar projects aiming to Algolize FORTRAN.
There was a FLEX preprocessor, (no relation to the flex lexical
analyzer,) and I saw a thesis from a student at a Mexican university
that basically duplicated Ratfor.
A well known Pascal book on data structures also had an section on
extending Pascal. (May have been Horowitz and Sahni?. I don't have it
anymore.)


Another option is books describing "toy" compilers:


* "Brinch Hansen on Pascal Compilers",
* Pyster's "Compiler Design and Construction" (Rascal),
* Wirth's "Compiler Construction"
  (Available on-line: http://www.oberon.ethz.ch/WirthPubl/CBEAll.pdf )
* Wirth again, the Pascal subset compiler described in "Algorithms +
Data Structures = Programs"


(Avoid the Small-C family, because of its had-hoc approach with no
theoretical background.)


String oriented languages such as awk and perl would be good
implementation languages for this type of project, regardless of what
the target is.


Hope this helps,


Roberto Waltman


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.