strangest systems I've sent email from

Mouse mouse at Rodents-Montreal.ORG
Fri Apr 29 21:09:20 CDT 2016


>> Sure.  Adobe postscript is a thread interpretative language (TIL).
>> It looks very much like FORTH if you squint real hard.

You'd have to squint pretty hard.  I'd say that PostScript is FORTH
with the stacks hidden and more datatypes added.  The major thing it
shares with FORTH is that it's a postfix stack language.  It does not
have things like R> and >R, or immediate words, or any of many other
things that FORTH can support _because_ it's threaded code running in
an interpreter with very simple data structures for things like
dictionaries.

> I don't know if PS is threaded.  It could be.  PS claims not to be inspired $

I find it easy to credit, actually; the only part of PS that I see as
layable at FORTH's doorstep is the use of a postfix stack model for
primitives' inputs and outputs.  PS has a lot of other things FORTHs
(in my admittedly limted experience) don't, such as many compound types
as first-class objects (dictionaries and arrays are the big ones),
data-as-code at a level that, while not quite up to Lisp, is far more
abstract that FORTH's "assemble a vector of threaded-code pointers"
model, and a number of hidden data types (hidden in that they are not
first-class language objects) like paths and graphics states.  Also,
PostScript has a lot of language syntax, whereas FORTH has immediate
words that act like language syntax.  (The difference is that FORTH
makes it possible to change those words, thereby changing the apparent
syntax.)

As for run-time versus compile-time name binding, PostScript does not
normally have any "compile time", since it's not normally compiled.
The closest thing is the assembling of an executable array, which you
can convert to "compile-time" binding with the bind primitive (as in
"/foo { dup cos exch sin } bind def", versus the same thing without the
bind).

A PS engine may use threaded code, but it does not need to; the
language is insulated enough from the implementation that it is
difficult-to-impossible for the PS programmer to tell.  FORTH is much
less insulated.

I am offering no value judgement either way.  In some respects, the
above differences make PostScript the better language; in others,
FORTH.  And that's as I think it should be: different languages for
different purposes.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse at rodents-montreal.org
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


More information about the cctalk mailing list