Path: utzoo!attcan!uunet!willett!dwp From: dwp@willett.UUCP (Doug Philips) Newsgroups: comp.lang.forth Subject: Re: PUZZLES AND PROBLEMS Message-ID: <1396.UUL1.3#5129@willett.UUCP> Date: 27 Jul 90 02:56:26 GMT References: <1385.UUL1.3#5129@willett.UUCP> Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 69 [BTW: I use all CAPITAL letters to indicate slight pause and slight added stress, not to indicate shouting. -dwp] In <1385.UUL1.3#5129@willett.UUCP>, W.BADEN1 [Wil] writes: > Forth may still be appropriate for such applications because of environmental > rather than linguistic reasons. Forth may be a good language to program > applications using operations for these things defined in another language, > e.g., assembler. I'm not sure what you mean by "linguistic" reasons. Do you mean that it is syntacticly simple, or that the stack orientation is too alien or ???? > It is ironic that Forth's name was chosen to suggest it is a fourth generation > language. The essence of 4GL's is that they indicate what to do, not how to > do it. The essence of Forth is the explicit specification of how to do > something. I've heard this before (probably from Wil). Everytime I heard it I was annoyed, but didn't know why. I think I now know why. Whether or not the why makes sense, I'm not sure yet, but I must disagree (albeit circuitously) with Wil on this point. Any conventional computer language is at some point going to have to say "how to do it". For example, consider SmallTalk. Everything in SmallTalk is done by sending messages to objects and getting some other object to do your work for you. (Almost... I realize that there are some syntactic deviations from that, but not in the direction I think is important for this point.) BUT, eventually you have to stop sending messages and actually do something, like an addition operation. In SmallTalk that is done by the virtual machine as a "primitive". SmallTalk is much less flexible than Forth because of the complexity difference between its virtual machine (Messages, Objects, etc.) and the underlying implementation OF the virtual machine. Anyway, the point is that there must be something inside of a Forth implementation that does the "how" of addition, etc. as well. I don't think that that level of "how" is sufficient to unseat Forth from its claim to being a 4Th generation language. Forth is, as far as I can tell, the only language so flexible that you don't actually write your application in Forth, but you use Forth to write the language in which you write your application. Consider a hypothetical example: (Ignore screwy capitalization) 90 degrees Left Arm X Axis Rotate ( Pick another order for the arguments to Rotate if you think it would scan better ) When you have the system "grown" to the point where the user can type that line of code and have it actually happen, the Forth system has evolved into a "what" NOT a "how". If it were a "how" it would look more like (hypothetically, of course): 90 degrees ( -- stepper motor step count for 90 degree rotation ) 0 ( I don't have my Forth Books handy, so add a SWAP to get the ) ( DO params in the right order, if necessary ) DO 3 MOTOR STEP LOOP Anyway, thats my buck two fifty: Forth is a "what" not a "how" language builder. One might even argue that "DUP" is a "what" and not a "how" word, but I'll save that for a later note. -Doug --- Preferred: willett!dwp@hobbes.cert.sei.cmu.edu OR ...!sei!willett!dwp Daily: ...!{uunet,nfsun}!willett!dwp [in a pinch: dwp@vega.fac.cs.cmu.edu]