Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!shakti!shri From: shri@ncst.ernet.in (H.Shrikumar) Newsgroups: comp.lang.forth Subject: Re: What makes Forth Forth Message-ID: <1179@shakti.ncst.ernet.in> Date: 13 Dec 90 16:43:57 GMT References: <9012051459.AA18739@ucbvax.Berkeley.EDU> <12692@medusa.cs.purdue.edu> <68713@unix.cis.pitt.edu> <14813@sdcc6.ucsd.edu> Reply-To: shri@ncst.ernet.in (H.Shrikumar ) Organization: National Centre for Software Technology, Bombay, INDIA Lines: 129 In article <14813@sdcc6.ucsd.edu> ir230@sdcc6.ucsd.edu (john wavrik) writes: >1. If a move is made to gain acceptance for the language in an > academic arena several things are needed -- among them the > ability to discuss the language in the way that other computer > languages are discussed. Very truly said. I use Forth(-derived-sort-of-postscript-like-sort-of-CSP-like-dialect) on my hobby-pony (6803,32Krom), and when my (academic) colleagues ask me "whats new in forth", "why forth", what do I say ? 1. Easy to "factor" code does not mesh, people do it in Lisp all the while. 2. Fast code ... "how about C, and good common-lisp." 3. Ease of use ... "with RPN, you must be joking.!" 4. Interactive ... "Lisp is great for that." A bit of introspection tells me that the real *first* reason I chose forth was ... 1. I dont have to sacrifice ROM for a big compiler/parser, RPN and dictionaries makes that trivial. 2. I dont want a symbol table to chew up my 16K RAM, and 3. please no Garbage to be collected in a 1Mips machine. 4. structured constructs to keep sanity, yet low-level when I need. In chose FORTH 'cos it is small, quick to implement, and can be bootstrapped into a new machine in a few evenings, incrementally. Then I got hooked. Now I talk RPN in my sleep :-) So when I talk to my colleagues, I take pains to first show how Forth and Lisp are similar, (stack, recursion (myForth thrives on recursion), functional abstraction); and immediately point out that Forth and Lisp are nevertheless quite different, Lisp is large, Forth is light, fast to implement and yet not bad to work in. This seems convincing enough to most. Now, I am beginning to look at Forth more as "core" language for such things as controllers. As applications get bigger, people will do cross-development in larger machines, with large environments, and generate Forth into the controllers. And when you wish to patch the code, you can do it manually quite easily, since Forth is friendly! (Aside: lots of code in the Shuttle computers, and in COCOTs etc, are written in higher languages, tested and tested to death, and even then patched by hand several times in their life cycle!) A good example is this sort of stuff is S-Bus F-code of Mitch. Its is very-powerful-future-proof-boot-auto-configure code, as well as friendly low-level debugging environment. I am not sure if it is smart to try to push Forth as a general purpose langauge. Dont lets get Forth and Lisp to fight, its not fair. It is ideal for light applications, (I dont for a moment mean "non-serious" ... light as in less number of data-structures and symbol spaces to manage in the core language, maybe the forth-generator does it.) >Doug Philips writes: > ># 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. > >I must be missing something: what point has been proved? >The popularity of Postscript is not the topic being discussed. Postscript code is generated by a front end program, Yet you can manually edit it easily. Why ? Because PostScript is RPN and stack (easy for code generators), and has dictionaries for factoring code (human-friendly), and yet all this fits in a small little board embedded in a printer. I agree with Doug, just add a { } to Forth, and clean up all the other syntactic-closures into this one beautiful construct, and you have post-script. The value of this has come up here often. Thus PostScript has proved the concept behind Forth. Also, the different attitude academia has to PostScript and Forth is not very well founded. Probably its history, "Forth is used to get a cheap processor to turn screws in a creaky telescope." Thats a wrong image for Forth. "Forth is a great embedded programming vehicle." is better. "Clean semantics, no side-effects unless you use @ and !, fuctional" are nice attributes. >I don't want to put words in Moore's mouth -- but I think you will >find that Forth was NOT created by developing a theory of what >characteristics a language should have, then making the language >fit the theory. Moore instead seemed to follow his instincts in >making design decisions as the language evolved. The result is Yes, I do emphatically agree with that. On the other hand, I'm sure CM wanted to keep the language light and yet factorable ... functions and abstractions yet no link-editors and other batch-mode artifacts. He thought an extensible dictionary gave him the latter, and the data-stack gave the first. Those were in fact his "theory of characteristics". OK, I have often heard such things as "Forth is great, 'cos I can have Scheme syntax in Forth" ... and so on. Has anybody got a good lazy-evaluation embedded in Forth, one whose syntax is clean (must look just like a @ ! or similar), and is quite efficient. The thing about functional programming is not the syntax, it is ability to let a compiler handle a lot, including type checking that is strong and yet polymorphic, optimise very well using such tricks as delayed-evals plus reduction of evaluation graphs. There is probably not much to write home about the BNF of Haskell, but the care taken to ensure that implementations can give such semantics as lazy-eval and make them efficient as well as intutive is what earns it respect in the "academic community". Has this been done in Forth ? Has it been done to Forth ? > John J Wavrik > jjwavrik@ucsd.edu Dept of Math C-012 > Univ of Calif - San Diego > La Jolla, CA 92093 -- shrikumar ( shri@ncst.in )