Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!hsdndev!cmcl2!acf5!sabbagh From: sabbagh@acf5.NYU.EDU (sabbagh) Newsgroups: comp.lang.forth Subject: Re: What makes Forth Forth Message-ID: <1408@acf5.NYU.EDU> Date: 8 Dec 90 16:27:10 GMT References: <9012051459.AA18739@ucbvax.Berkeley.EDU> <12692@medusa.cs.purdue.edu> <14789@sdcc6.ucsd.edu> <68713@unix.cis.pitt.edu> Reply-To: sabbagh@acf5.UUCP () Organization: New York University Lines: 76 In article <68713@unix.cis.pitt.edu> dwpst@unix.cis.pitt.edu (Douglas W Philips) writes: >In article <14789@sdcc6.ucsd.edu> ir230@sdcc6.ucsd.edu (john wavrik) writes: >> I *DO* see an objection -- and I >>regard a strength of Forth as the ability to add new objects with >>first class status. This ability comes from the fact that the Forth >>programmer has access to the language at the level at which primary >>objects are introduced... > >Well, what do you say to the C++/Ada/Smalltalk people then. They can >certainly do that too. I am currently doing my dissertation work in C++, but have had some Forth experience, so I'll try to field this question, at least for the C++ case. I believe these remarks hold for Ada and Smalltalk as well. It is true that you can overload the semantics of operators in C++, however, there are two problems: 1)you can't overload the _syntax_ and 2) you can't define new operators. 1) causes a problem in the following case: cout << 10 < 20 ? 1 : 0 << endl; which appears a lot; this is the "iostreams" way of writing things to standard output (referred to by cout). Most people want this to print "1", but in fact it prints "10"! This is because "<<" has higher precendence than the trinary operator ?:. Does this make sense for the output stream operator? No! The operator inherits the precendence of the original left-shift operator found in the origin C definition. So, overloaded operators are 1.5 class objects. How does Forth overcome this? Simple: there is NO PRECEDENCE. Forth is the true equal opportunity language: IT MAKES NO ASSUMPTIONS ABOUT WHAT YOU MEAN. Of course, this means that most of the burden is placed on _you_, but this can be handled by building a large collection of small tools. IMHO the thing that Forth implementations need the most is some way to manage large dictionaries! That's what makes Forth inaccessible to most people. The documentation requirements are much higher; not documenting acutal program, since Forth programs are self-documenting, but _systems_ documentation, i.e., what it does, which are interface words and which are implementation, etc. >>P.S. The main challenge to the Forth community is to show that >> putting more control over the language in the hands of the >> programmer can result in more power without drastically >> increasing error or increasing the incidence of incompre- >> hensible programs. > >I have seen nothing so far that would enable me to distinguish PostScript >from Forth. In fact, the power and popularity of PostScript would seem >to have proved the point already. Frankly, neither have I. I can only say that Postscript was not really designed for humans to write programs in, and Forth was. I have discovered that intellectual purity in computer language design is _far_ less important than pragmatic issues: can I write a program in this language. Finally, to answer the obvious question: why can't I use Forth for my dissertation work? The answer is: I REALLY WANT TO. I purchased Mitch Bradley's C Forth 83, which is a fine implementation of Forth (really outstanding, actually). I am using a SGI Personal Iris workstation, which has a large library to support 3d graphics. The problem is in extending Forth to provide a development environment that I'm used to. It can be done (and, in hindsight, would have taken as much time as learning C++) but it is not a small task for someone who's not being paid to be a systems programmer. Hadil G. Sabbagh E-mail: sabbagh@cs.nyu.edu Voice: (212) 998-3125 Snail: Courant Institute of Math. Sci. 251 Mercer St. New York,NY 10012 "There's a difference between being hungry and being on a diet." - Commentary about John Cougar Mellenkamp. Disclaimer: This is not a disclaimer.