Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!ucsd!sdcc6!ir230 From: ir230@sdcc6.ucsd.edu (john wavrik) Newsgroups: comp.lang.forth Subject: Teaching Pros Message-ID: <11674@sdcc6.ucsd.edu> Date: 30 Jun 90 00:07:24 GMT Organization: University of California, San Diego Lines: 112 Doug Philips writes: % I once asked Wavrik (via proxy when he was a guest on FIG's GEnie % RoundTable) if there were any particular methods that were effective % in helping programmers already proficient in other languages to % unlearn their bad habits and learn Forth. The response was not very % heartening. Here is what I said (and it was intended to be encouraging): <[John W]> I think Forth has to be met on its own terms.. <[John W]> I stress this -- so that my students know that they are not.. <[John W]> just dealing with a conventional language.. <[John W]> I probably present Forth in a way that most conventional languages are not presented... <[John W]> I teach it in terms of how it is implemented... <[John W]> (It is one of the few languages that can be taught that way.. <[John W]> As a result, rather than looking at syntax (how things are said).. <[John W]> The focus is on semantics (what things mean, or do)... <[John W]> The orientation is different from the beginning.. <[John W]> and I think it helps students confront Forth as it is.. Let me amplify a bit. First let's talk about utility. Question: What has more utility (a) A pile of wood, a hammer, a bag of nails and a saw OR (b) A wooden doghouse? Answer: If what you want is a wooden dog house, then the wooden dog house has more utility. If you have in mind a shed for garden tools (or, in fact, anything other than a dog house) the building materials have more utility. A dog house is just a dog house -- the building materials can be used not only to build dog houses but, more importantly, structures exactly designed for your needs. Forth is a toolshop language rather than a toolbox language. A toolbox has things like screw drivers, hammers, nuts and bolts, etc. A toolshop has lathes, welders, drill presses, etc. A toolshop contains tools to build screw drivers, hammers, etc. There is nothing novel in the idea that jobs are done best when a worker uses the proper tools and can become almost impossible with unsuitable tools. What is novel is the idea that toolbuilding can be simplified to the point where it is quicker and easier to make yourself the proper tools: making a hammer rather than trying to build a house driving nails with the handle of a screwdriver. What Charles Moore did for computer programming is to show how to dramatically increase the utility of a computer language by providing access at a lower than customary level. Moore provides the programmer with the tools needed to build the language itself and, just as important, has made these tool-building tools simple. In a quest to solve a larger variety of problems, conventional languages have responded by making larger and heavier toolboxes -- Moore has, instead, improved the toolshop making it accessible, powerful and simple. My students have already seen other languages -- so I don't have to explain why computer languages need control structures or what a stack is. Exposure to conventional languages tends to produce a mindset which regards a language as something defined by syntax diagrams and which regards the toolshop as complicated and off limits. What better way to introduce students to the idea of a simple and powerful workshop than to show them how it is used to build the language -- and how the syntax falls into place when one understands the actions of the words. The worst thing that one can do with Forth is to teach it as if it were a conventional language with a funny syntax. The idea of teaching Forth by introducing SEE, VIEW and DUMP very early in the game works very well for people who know something about programming. The approach is not really unusual. In mathematics, students are often faced with a choice: either memorize 1000 formulas or understand the 10 simple ideas which are responsible for them -- so the subject is taught by going for the ideas. Just as in Forth, the 10 ideas have greater utility than the 1000 formulas -- so students wind up with not only a better understanding but with a simpler approach and more power. That being said, one should also not go overboard in stressing the unconventional nature of Forth. Moore's work, in many areas, anticipated the path that mainstream computer science has taken. Programming in Forth does not require a bizarre style -- well written Forth is a lot like well written anything else. A good part of a course in Forth just deals with the process of taking ideas and translating them into correct computer programs. In 10 years of teaching Forth, I have never had a student whose programming in other languages was not improved by a course in Forth. There is one problem that does arise. Charles Moore has observed that Forth is an amplifier: it exposes rather than covers up deficiencies in programming. I regard this as a good thing. If a student cusses out Forth -- don't jump in immediately to defend the language -- ask, instead, to see some samples of things he has written in his favorite language -- you may discover that the help he needs goes beyond Forth. I don't think that Forth is particularly difficult to learn. My course is in Computer Algebra rather than Forth per se. I mix programming tasks, mathematics, and language instruction together and the course is more about mathematics and algorithms than Forth -- yet most of the students can do simple projects within the first few weeks and fairly complex projects by the end of 10 weeks. I should mention that I use a traditionally implemented Forth for the course (I've used Kitt Peak VAX-Forth, MVP, and now F83). I can't guarantee that things will work out as well if you insist on using a Teenage Mutant Ninja Forth. John J Wavrik jjwavrik@ucsd.edu Dept of Math C-012 Univ of Calif - San Diego La Jolla, CA 92093