Re: Postscript as a target language? (Ciaran McHale)
Mon, 9 Aug 1993 10:39:04 GMT

          From comp.compilers

Related articles
Postscript as a target language? (1993-08-08)
Re: Postscript as a target language? (1993-08-09)
Re: Postscript as a target language? (1993-08-09)
Re: Postscript as a target language? (1993-08-09)
Re: Postscript as a target language? (Chris DONAWA) (1993-08-09)
Re: Postscript as a target language? (1993-08-10)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Ciaran McHale)
Keywords: courses
Organization: DSG, Dept. of Computer Science, Trinity College Dublin
References: 93-08-040
Date: Mon, 9 Aug 1993 10:39:04 GMT (Al Stavely) writes:
>[Al is considering the use of PostScript as a target assembly language
>for a compilers course he will be teaching]
>Is this a completely silly idea? Does anyone have any thoughts on this, or
>any experiences to share?

Two disadvantages which I can see are:

o Error handling/reporting is PostScript is rather poor which
can make it difficult to locate errors in the generated code.
You can look on the Adobe ftp site,, in the
Programs directory for some software which will improve the
quality of the error diagnostics but it is still poor relative
to messages one might hope to get from, say, a C compiler such
as "Error on line 245 near `foobar': semicolon was expected".
(In case you don't have ftp access, an automated mail server
mirrors the ftp site; send an email with _just_ "help" in the
Subject: line and an empty text body to
"" for further details.

o The PostScript concept of dictionaries means that the binding
of variables is completely independent from which procedure is
currently executing. Your students may find this difficult to
grasp if the only languages with which they are currently
familiar have variables whose lifespan is related to the
lexical scope in which they appear. It _is_ possible to have
the concept of "local" variables in PostScript but you get it
by following a programming convention rather than it being
provided for you automatically by the PostScript interpreter.
Assuming your students are not already familiar with the
concept of dictionaries, I don't know how difficult/easy it
would be for them to grasp the essentials so that they could
be comfortable using dictionaries. I certainly remember
finding it difficult to grasp the concepts involved though I
learned PostScript from books rather than being taught by a
teacher. Alternatively, one _could_ simply ignore this issues
and use just a single dictionary (perhaps the default one
"userdict") thus treating all variables as global.

You might also consider posting to comp.lang.postscript for comments.

---- Ciaran McHale (
\bi/ Dist. Systems Group, Department of Computer Science, Trinity College,
  \/ Dublin 2, Ireland. Telephone: +353-1-7021539 FAX: +353-1-6772204

Post a followup to this message

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