[H-GEN] Laser Printer
David Jericho
davidj at pisoftware.com
Thu Mar 18 19:32:51 EST 2004
Tony Melia wrote:
[On the sineballs Postscript code]
> Can I ask a dumb question - how the hell does a complex image like that only
> take up 705 bytes of source??
Postscript isn't like traditional raster printer languages, in that you
can actually write macros (or a dictionary as the correct term is) and
execute loops, along with all sorts of happy joy fun activities.
Postscript itself is Turing complete.
I asked David Makepeace yesterday (Postscript is one of his many hidden
talents) how it worked, and he went through and showed me the various
expansions of the code. He's the best one to explain it, but I'll
attempt to repeat a concise version of what he said.
The first task the program did was uncompress itself, and expand the
code out to something that Postscript can actually use. Once it's
uncompressed (not quite true, but good enough for the explanation), it
defined a dictionary of raytracing commands, and then simply stepped
through a series of function calls in a loop to raytrace the image.
Given the Postscript is Turing complete, it's quite possible to write
all manner of things in it. I've heard of portscanners being written and
run from printers, of distributed.net crackers (where the results are
OCRed back in), and even web servers.
--
David Jericho
Senior Systems Administrator, Tucana Technologies
More information about the General
mailing list