Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!willett!dwp From: dwp@willett.UUCP (Doug Philips) Newsgroups: comp.lang.forth Subject: Re: Why is Postscript not Forth? Message-ID: <464.UUL1.3#5129@willett.UUCP> Date: 14 Feb 90 00:54:16 GMT References: <9002121711.AA24864@jade.berkeley.edu> Organization: Latest link in the ForthNet chain. (Pgh, PA) Lines: 50 In <9002121711.AA24864@jade.berkeley.edu>, wmb@ENG.SUN.COM (Mitch Bradley) writes: > The fundamental differences: [between Forth and PostScript --dwp] > D1) PostScript is strongly typed. Forth is not typed at all. This > difference is profound. It affects just about everything. I agree. This is a difference I was not originally aware of. > D2) PostScript has one way to make a closure, i.e. { .. } . All > PostScript control structures use this one basic mechanism, and > are otherwise postfix. Each Forth control structure creates its > own special flavor of a closure, and the syntax is not postfix. I'm not yet willing to concede this point. If it is fairly simple to create the other language's closures then I don't see this as fundamental. I'm not sure how I'd define 'fairly simple' but I'd rather consider the extremes of the scale, and hope that the actual values are near one of the extremes. > D3) This is not articulated in either language specification, but in > practice, it is nearly alway true: Forth gives you pretty much > direct access to machine hardware data types (addresses, integers, > logical bit patterns), whereas PostScript doesn't. I'm also not sure about this one. Perhaps its just a matter of a different kind of underlying hardware? (I don't know enough about this issue except to ask: How is this different from a chip that directly executes Forth? Perhaps a moot point.) > D4) Defining words in PostScript are postfix and can be used at any > place within a definition, either while compiling the definition > or while executing it. Defining words in Forth are prefix. They > cannot be used while compiling a definition, and only in a restricted > way while executing a definition (specifically, you cannot, for > instance, easily write a Forth word which creates a word called > "foo", unless you can arrange for the name "foo" to appear in > the input stream at the time your word is executed). I take it from this that by 'easily' you mean: 'without knowing how the dictionary structure of the Forth you are using works,' or perhaps, 'in a portable manner, across more than one type of Forth.'? > D5) PostScript defaults to run-time binding, with compile-time binding > as an option; Forth uses compile-time binding, and run-time binding > requires explicit coding effort to create a DEFER word or its equivalent. I agree that this is a fundamental difference. -Doug --- Preferred: willett!dwp@gateway.sei.cmu.edu OR ...!sei!willett!dwp Daily: ...!{uunet,nfsun}!willett!dwp [in a pinch: dwp@vega.fac.cs.cmu.edu]