🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #8222

PostScript emulator in Smalltalk

#8222
From: Trevor Hopkins
Date: Tue, 11 Apr 1989 15:58
53 lines
3368 bytes
In article <89Apr10.105518edt.9310@ois.db.toronto.edu> fche@db.toronto.edu
writes:
>
>	Does anyone know of a (working) postscript emulator for
>	Smalltalk?  Such things exist for X11 and other things,
>	but having one written in Smalltalk would be very useful
>	to a project we are working on.

I felt this reply might be of more general interest, so I've followed-up to
the net.

A final year undergraduate student called Greg Ngan wrote a Postscript
interpreter in Smalltalk-80 for his final year project (1988).  This
allowed Postscript code to be selected and executed in one subview, with
the resulting output being displayed in another subview.  Postscript code
could also be executed from selected files.

The structure basically consisted of a stack-based interpreter (classes for
this, of course), plus some classes which supported the `painting'
structure expected by Postscript, plus some View and Controller classes.

The interpreter basically worked, but Greg did not have time to implement
all the postscript primitives, so it must be regarded as a subset
implementation only.  Strokes and fills worked well (at least within the
limitations of the screen display), and it could produce quite a reasonable
rendering of (say) the `Mac Golfer' image.  It was very weak at text, as
(for simplicity) it used the Smalltalk fonts, and scaled then as necessary.
Only some kinds of bitmaps were displayable.  It was also fairly slow, even
using PS2.2 on a Sun 3/60.

Being a undergraduate project performed by someone with no previous
Smalltalk experience, the quality of the design (class hierarchies, etc.)
and implementation techniques leave something to be desired (read: awful
Smalltalk style), so this work has not yet appeared as a `goodie'.  At one
time, I had intended to do some `cleaning-up' work on it, and make it more
generally available, but I've not got around to this just yet.

My feeling is that a good Smalltalk programmer who also understood
Postscript could do a good job of building a Postscript interpreter in
Smalltalk.  I'd tend to regard Greg's work as an experiment, and start
again from scratch, however.  (This is called `prototype software
development :-)

If anyone wants a copy og Greg's report, send me a postal address.  I don't
really want to release the code (it really is *disgusting* :-).

Trevor.
------------------------------------------------------------------
Trevor P. Hopkins, Room 2.95, Department of Computer Science,
University of Manchester, Oxford Road, Manchester, M13 9PL, U.K.
Tel: (+44) 61-275 6170    Internal: 6170
JANET: trevor@uk.ac.man.cs.ux    UUCP: ..ukc!man.cs.ux!trevor
------------------------------------------------------------------
Technical Details
Message-ID: <5825@ux.cs.man.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!ukc!mucs!trevor
References: <89Apr10.105518edt.9310@ois.db.toronto.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!ukc!mucs!trevor
From: trevor@ux.cs.man.ac.uk (Trevor Hopkins)
Newsgroups: comp.lang.postscript,comp.lang.smalltalk
Subject: PostScript emulator in Smalltalk
Summary: It's been done (sort of)
Keywords: PostScript, emulation, SmallTalk
Message-ID: <5825@ux.cs.man.ac.uk>
Date: 11 Apr 89 15:58:53 GMT
References: <89Apr10.105518edt.9310@ois.db.toronto.edu>
Reply-To: trevor@mucs.UUCP (Trevor Hopkins)
Followup-To: comp.lang.smalltalk
Organization: Computer Science, University of Manchester, UK
Lines: 53