Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!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: <528.UUL1.3#5129@willett.UUCP> Date: 22 Feb 90 02:29:56 GMT References: <9002210136.AA20515@jade.berkeley.edu> Organization: Latest link in the ForthNet chain. (Pgh, PA) Lines: 53 In <9002210136.AA20515@jade.berkeley.edu>, wmb@ENG.SUN.COM writes: > [wmb points out that doing Forth's closures in PostScript is easy > but that doing PostScript's cloure(s) in Forth is not easy. I > concede that this indicitive of an essential difference between > the two languages and raise the question: "doesn't this mean that > Forth's closure making words are improperly factored?"] > It certainly does. The problem with trying to factor them is that > there are so many different things going on with the different kinds > of closures. The "branch class" of closure (BEGIN and IF structures) > can be easily factored, but the DO class has some other wierd things > going on, the ":" class throws in some more wrinkles, and then DOES> > wierds it out even more. Serious "ad-hoc" action here. Ah, but is there some small/fundamental/underlying set of closure making words which can be combined to form these existing words such that the 'ad-hoc quirks' of these words is an artifact of the combination of the more primitive words instead of being inherent 'ad-hoc quirks' of the most basic building blocks? > PostScript already provides words to convert between types, but some > pairs of types are not mutually convertible. The original point was > that Forth is inherently untyped and PostScript is inherently strongly > typed, and that this difference is fundamental. The above argument > supports that claim. In Forth, you can ultimately do anything you want > with a stack cell, and in PostScript, you can only do "type consistent" > things. It doesn't really matter if you can't go immediately from one type to another. All that matters is that some sequence of type converting words can get you from one place to all the other places. If the type system has disjoint partitions, then this is true and I'll concede the point. If there are no disjoint partitions then it is merely a matter of convenience (i.e. having to write your own foo->bar word that does the twelve necessary intermediate type perturbations). > [Streams, even if correctly done, don't solve the problem with > improperly factored closure creating words.] > Absolutely right. The dictionary manipulation words in Forth are factored > VERY poorly. By the way, once you have a word like $CREATE (like CREATE > but takes a string from the stack), then you need $: and $DEFER and > $whatever_other_defining_words_you_care_about . If defining word syntax > were postfix, and the notions of declaring the action class and creating > the name were separate, then this problem wouldn't exist. See my comment above. If you have the right fundamental wordset, you can define the current closure-making words using it (although you'd most likely want to use CODE words for speed). BUT, once you have the right closure making words, you can go beyound Forth's current ad-hoc-ism to something simpler, cleaner, etc. (conceptually and implentationally). -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]