Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!spool.mu.edu!news.cs.indiana.edu!purdue!bouma From: bouma@cs.purdue.EDU (William J. Bouma) Newsgroups: comp.lang.forth Subject: Re: Forth and CS Message-ID: <13699@medusa.cs.purdue.edu> Date: 6 Mar 91 04:45:29 GMT References: <3554.27d21955@iccgcc.decnet.ab.com> Organization: Department of Computer Science, Purdue University Lines: 83 In article <3554.27d21955@iccgcc.decnet.ab.com> schmidtg@iccgcc.decnet.ab.com writes: >Interesting, I would categorize LISP as a language with a somewhat >"weak" syntactical structure, yet much of LISP's power results from >this. In LISP, everything is pretty much a lump of "LISPstuff" where Ah, I am known around here as "Mr. Lisp"! (But this is a Forth group) Lisp has more syntax than Forth. It is always "(function arg arg ...)". True it is a simple syntax, but I wouldn't call it weak. You can see what I mean by trying to send to the Lisp interpreter something not encased in parenthesis. In Lisp it is easy to see what arguments are to what functions. You can have functions with optional numbers of arguments and keyword arguments. Forth cannot do this because of its weaker syntax. What Forth can do that Lisp cannot is transparently return more than one value from a function. ie. Lisp cannot have a function a2 which takes two arguments and a function b2 which returns two values and say "(a2 (b2))". This comes for free in Forth because of the lack of syntax. As always, tradeoffs depending on what you want to do. To say absolutely (as some have) "syntax sucks" is idiotic. >meaning is imparted not by syntax, but rather by program structure, Can you clarify the difference? I think our discussions up to now have all been pretty consistent about what syntax means. The way I see it the structure is the syntax. Perhaps I just don't follow what you mean. Assembly language basically has no syntax. But I find Lisp code easier to read than ASM because its syntax conveys meaning to me. I convey to the Lisp interpreter what is a separate list by the syntax of enclosing it in parenthesis. While it is true that a list of machine code has meaning without having any syntax, that does not negate the fact that syntax conveys meaning. >I wonder what prompts you to say this, as I have seen no evidence of what >you are describing within this newsgroup. Keep in mind that Computer >"Science" is still in it's infancy. It is not some "holy grail" which >may not be questioned. Certainly tradition has a lot to do with the How long have you been reading it? 8^) Perhaps I was a bit harsh. I was certainly not implying that CS is perfect. Only that some of the Forthers criticizing it don't seem to know much about what they are attempting to criticize. Several times in this group I have seen people praising the virtues of Forth over that of other languages, but it is apparent that they have had very little experience with other languages. >it interesting that some of the current trends towards "object oriented" >languages and "rapid prototyping" have been enjoyed by the more experienced >FORTH programmers for years. "object oriented" programming had been going on for a long time before so called "software engineers" jumped on the bandwagon and made the term popular. That is not unique to Forth programmers. It easy to look back now and say Forth was ahead of its time in this area. But why didn't someone publish about constructs in Forth to support OOP before any of the OO specific languages had been built? >LISP has gravitated to the AI community and FORTH has gravitated to the >embedded processor arena (I still consider FORTH to be an excellent "general >purpose" language and I am sure many would say this about LISP too). I do not think Forth is a very good general purpose language. The reason is same one (I believe) that has kept and will keep Forth from being accepted generally. The lack of a type system is what has kept Forth down. A language that deals only with characters and integers is a joke. It is no coincidence that Forth gravitated to the embedded processor area, they don't need to deal with anything besides integers and characters. Forth will not be accepted academically or be useful generally until it adopts a general consistent way to deal with a wide variety of types. Though Lisp is still used a lot in AI (whatever that is) it has gravitated back to general purpose. Lisp has been my main programming language for 4 years and I don't think I have ever written any "AI". >The point that I am trying to make is that FORTH has not received the >widespread acceptance that it deserves, it has had no "Academic sugar daddy" 8^) Perhaps. Perhaps it just isn't that deserving of attention from people who aren't tring to interface to hardware or aren't limited to 64K of memory. -- Bill