John Peterson
peters...@cs.yale.edu
Yale Haskell Project
Has anyone done such a thing?
--dave yost
The nice thing is that Lisp and PS have many features in common, so the
mapping can be pretty straightforward. Specifically, they both have
manifest typing and dynamic allocation with garbage collection. The latter
is often the hardest part of any Lisp implementation, but the implementor
of this translator wouldn't have to worry about it.
--
Barry Margolin
System Manager, Thinking Machines Corp.
bar...@think.com {uunet,harvard}!think!barmar
See "PLisp, A Lisp to Postscript Compiler", by John C. Peterson, University of
Arizona, TR 86-29, December 1986.
--mark
That is, given the choice and identical functionality, who
would prefer to program in Lisp?
Scott Byer NeXTMail: by...@adobe.com
Adobe Systems Incorporated These are *my* opinions, and
1585 Charleston Road, P.O. Box 7900 do not necessarily reflect
Mountain View, CA 94039-7900 the opinions of my employer.
---------------------------------------------------------------------
Chip
>...and dynamic allocation with garbage collection. The latter
>is often the hardest part of any Lisp implementation, but the implementor
>of this translator wouldn't have to worry about it.
Level 1 PostScript interpreters didn't have garbage collection...that's why
the save/restore ritual mattered so much. There's nothing to say that
they *couldn't* have had garbage collection, but just that none of them
[as far as I know] *did* have it.
Even in Level 2, it's not clear that the garbage collectors will be capable
of compaction. This might make a difference in LISP-like memory usage.
--
Dick Dunn r...@raven.eklektix.com -or- raven!rcd Boulder, Colorado
...Simpler is better.
Given a choice and identical functionality, I would prefer to program
in Forth. Postscript is pretty close, but there's some design problems
that I'd rather not have to workaround all the time (little things like
the ordering of the arguments to DEF, the artificial distinction between
DEF and SET, and so on).
--
/F{findfont exch scalefont setfont}def /S{moveto show}def /T{/Times-Roman F}def
8 T(Ferranti International Controls Corporation)24 28 S(+1 713 274 5180)24 12 S
(Sugar Land, TX 77487-5012)24 20 S 12 /Courier F(`-_-')320 32 S( 'U` )320 16 S
12 T(Peter da Silva)24 36 S 16 T(Have you hugged your wolf today?)358 24 S
I am interested to know more about this debate.
Simon Ward
Faculty of Environmental Design
University of Canberra
The one tricky point is where several composite objects (like arrays
and strings) overlap the same piece of VM, in which case the whole lot
has to be moved together.
The design of PS2 is very careful to allow independant garbage
collection of local VM spaces without having to consult global VM,
which allows truly concurrent collection as well...
I think you can also do a generation based collection as well, but
that gets a little complex (interaction with save/restore).
--
------------------------------------------------------
|\ /| | , M. Tillotson Harlequin Ltd. \
| \/ | /\| |/\ |< ma...@uk.co.harlqn Barrington Hall,\
| | \_| | | \ +44 223 872522 Barrington, \
I came, I saw, I core-dumped... Cambridge CB2 5RG \
My opinions, like my teeth, are all my own (and full of holes?)\
Correction: There is no *theoretical* problem with using compaction.
The practical difficulties are implementation issues inside the
interpreter. How do you get a Level 2 interpreter? If you had a
Level 1 interpreter, you probably start with a massive revision to
that code. Adding garbage collection to existing code probably isn't
a major disaster--you have to be careful that none of the code (we're
talking interpreter code, not the PostScript) holds on to anything
the garbage collector doesn't know about. Everybody needs to under-
stand the rules about when GC can happen. While it's not that much
harder to deal with compaction at the outset, retrofitting it can be
hard. You may find some deeply-rooted assumptions that the address
of an object won't change after it's created. It's this practical
difficulty that might make an implementor decide not to compact even
though it's theoretically OK.