wmb@MITCH.ENG.SUN.COM (Mitch Bradley) (03/02/91)
> > ... syntax is a waste of time > > What a lame thing to say! (esp. comming from someone who I agree > with 98% of the time) Syntax is a major conveyor of meaning. How > could anything be communicated (esp. programs) without syntax? Forth > may have flexible syntax, but it definitely has syntax. More precisely, when I said "syntax", I meant "non-trivial syntax, and the parsers that are required to evaluate it". The dividing line between "trivial syntax" and "non-trivial syntax" is open to argument, but in my book, Forth syntax is clearly in the trivial category. "Proof": I can describe the entire Forth lexical analyser/parser to any half-decent programmer in less than 5 minutes, without using any big words. I don't need to talk about break sets or scan sets or context free grammars or left recursion or recursive descent or LR-K or production rules or any of those other things in order to describe Forth's syntax or its parser. Before I got turned on to Forth, I used to spend lots of effort defining command syntaxes with commas and colons and brackets and optional fields and stuff. Now I just write Forth words that do one thing and are finished. To my way of thinking, any syntax more complicated than what Forth already has is probably too complicated. I would even claim that Forth has a bit too much syntax (for example, the Forth control structures are sort of syntactic in nature; PostScript shows how to avoid that syntax). Mitch
bouma@cs.purdue.EDU (William J. Bouma) (03/06/91)
In article <9103031940.AA02024@ucbvax.Berkeley.EDU> Mitch Bradley <wmb%MITCH.ENG.SUN.COM@SCFVM.GSFC.NASA.GOV> writes: >To my way of thinking, any syntax more complicated than what Forth already >has is probably too complicated. I would even claim that Forth has a >bit too much syntax (for example, the Forth control structures are sort >of syntactic in nature; PostScript shows how to avoid that syntax). In all functional programming languages the main reason syntax is there is to distinguish which are the functions and which are the arguments. Forth simply says, "the arguments are on the stack". Without control constructs and words like : ." ( [ Forth would have no syntax at all. (In Postscript only {) The Forth programmer makes up for the loss of syntactic information by heavy commenting of what is on the stack and by formatting his code to show the structure. More syntax could be beneficial by requiring less com- menting, forcing beginners to structure code properly, and allowing some errors to be caught earlier. Forth is appealing in the freedom it doth give, though. I have to dissagree with the blanket statement Mitch makes above about complication. It sounds like more of this "Forth is god" ramble. For the only language that is as uncomplicated in syntax is Forth or one of its clones (PS included). Is it not enough just to say "I like the minimal syntax Forth has for the freedom it doth give..."? Why condemn every other language in the process? Non- functional languages require a lot more syntax. These languages have strong points just as Forth does. The ultimate language has not yet arrived. Syntax has not seriously gotten in my way, so I do not understand where Mitch is comming from on this. -- Bill <bouma@cs.purdue.edu>