Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!swrinde!cs.utexas.edu!uunet!pilchuck!amc-gw!thebes!mtk!marmar From: marmar@mtk.UUCP (Mark Martino) Newsgroups: comp.lang.forth Subject: Forth/PostScript Summary: Separated at birth? Message-ID: <935@mtk.UUCP> Date: 27 Nov 89 16:08:25 GMT Reply-To: marmar@mtk.UUCP (Mark Martino) Distribution: usa Organization: Mannesmann Tally, Kent, WA 98032 Lines: 35 When I first looked at PostScript, I viewed it as Forth with some elaborate graphic words. I still believe one could do the same things PostScript does by using Forth with graphic words, but I've discovered quite a few differences between Forth and PostScript. 1) In PostScript, all operands on the operand stack are eight bytes long. Some of them include a pointer to other data. 2) There are sixteen data types in PostScript. 3) Although I haven't made much use of this feature, it is true that in PostScript one can use any of the sixteen data types as a key to find anything else in a dictionary. I don't think you can do this in Forth, but like I said, I'm not sure how handy this is anyway. 4) PostScript tags everything you create with a save level number. It uses this number as a mechanism for memory allocation via the operators "save" and "restore". The tag is part of the eight bytes in an operand. 5) This next one may be implementation dependent, but the two interpreters I've looked at allow, even require, that you be able to call the interpreter recursively. 6) A PostScript interpreter takes over 300 Kbytes of compiled code. And I have to differ with conventional wisdom here. The amount of code is NOT just because of "a rich set of graphic operators". Forth could draw the same lines and paint the same pictures for a lot less code. What takes up the space in PostScript is the data structures it uses and the operators dedicated to handling these structures. Also, except for one implemenation in Forth, PostScript is written in C and a little assembly language. 7) A large part of PostScript is aimed at creating lovely fonts and it does this very well. One other thing, PostScript was intended to generate images in a way that would reduce the amount of transmitted data. Although Forth started out controlling telescopes, it has a more general purpose than PostScript. general charter than that