home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / forth / 3101 < prev    next >
Encoding:
Text File  |  1992-09-09  |  14.2 KB  |  271 lines

  1. Newsgroups: comp.lang.forth
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!decwrl!csus.edu!csusac!citrus!tree!alan
  3. From: alan@tree.UUCP (Alan)
  4. Subject: Re: Sampler Forth
  5. Organization: The UNIX Tree Public Access *ix  (916)349-0385 Sacramento, CA
  6. Date: Wed, 9 Sep 1992 17:45:52 GMT
  7. Message-ID: <1992Sep9.174552.22223@tree.UUCP>
  8. References: <4303@wet.UUCP>
  9. Lines: 260
  10.  
  11. In article <4303@wet.UUCP> jpeters@wet.COM (John A. Peters) writes:
  12. >SAMPLER FORTH                      Revised September 9, 1992
  13. >
  14. >Suggestions from the Silicon Valley FIG meeting August 22, 1992.
  15. >Additional comments by letter from Jerry Mueller on Aug 29, 1992  
  16.           
  17. >Most of us are too involved inside Forth and haven't backed off
  18. >and looked at Forth through non Forth eyes.  We need to keep in
  19. >mind that the visitor is not worried about speed or using to much
  20. >memory or being redundant or figuring out how to actually do
  21. >something.  The following will make Forth acceptable to the
  22. >general public.  It's goal is to be conventional.
  23.  
  24. >FLOATING POINT default with a toggle words called FLO and INT.  
  25. >     The model is the simple pocket calculator.  Think of the
  26. >     language Basic or a pocket calculator as the convention
  27. >     people are used to.  Example: No F* fDUP or F/ etc.  Just
  28. >     simple  *  /  +  -  in each mode.  Ideally the use off a
  29. >     decimal point or comma will perform this toggle.
  30.  
  31. I used to hear the lack of floating point support defended as a
  32. Forth virtue on a regular basis.  This was one of the most pathetic
  33. arguments I'd ever heard and was reminiscent of "if God had meant us to fly
  34. we'd have been born with wings." Thankfully, most of the dinosaurs
  35. who were promoting this (along with block files) have apparently died or
  36. evolved into birds.  Please understand, there was (and sometimes still
  37. is) merit to using integer math and block files -- there's NO merit to not
  38. having a choice.
  39.  
  40. >A lot of people resist RPN.  A lot of people have the idea that
  41. >HP calculators are all RPN.  HP went with the flow and changed -
  42. >their newer calculators all have algebraic entry, with RPN as an
  43. >option.  Provide two Forth words: ALG (for algebraic) and RPN. 
  44. >Type ALG and you can type:
  45. >(5*6)+(4*5)/(2*5) 
  46.  
  47. >RPN entry.  This means that _(_  (paren) must always have a 
  48. >following space as is the case now.  With out a following space
  49. >it is a algebraic instruction and should not be used for comments
  50.  
  51. >Sequential files with a toggle between .SEQ and .BLK files.  The
  52. >     editor can read the file extension and do the right thing.
  53.  
  54. >A simple interface.
  55.  
  56. I may -- or may not -- agree with you, depending on what you mean by
  57. "simple".  If you mean *stark* simple then I disagree -- the "simple
  58. mindedness" of most Forth interfaces seriously dates them and generally
  59. makes them anything BUT "simple to use."  A "simple" (aka "clean" and
  60. smart) full screen interface would be an excellent idea.
  61.  
  62. >Error resistance and compiler security.  Range checking for 
  63. >     EXECUTE  ! "store", C!, MOVE, and CMOVE etc.
  64.  
  65. This is something which seems so obvious -- but I've never before
  66. seen it suggested on the net.  Forth people like to argue things like
  67. "but range checking will slow Forth down" and "if you properly factor
  68. and use the stack you don't need range checking".  I heard analogous
  69. Lilliputian-brained arguments used to defend the status quo line editors when
  70. full screen editors were beginning to debut.  What would be wrong with robust
  71. range and error checking which could be turned off once you got the kinks 
  72. worked out?  A while back there was discussion of writing an editor
  73. similar to "emacs" with Forth as the embedded programming language.
  74. One of the two biggest problems I saw with that idea is that people
  75. wouldn't put up with an embedded programming language which might
  76. crash and wipe out their document anytime they were running a new
  77. "macro" on their text just because they made a silly logic/range mistake.
  78.  
  79. >Lots of Examples.  Three examples per concept at a minimum.  
  80.  
  81. >Sound and color.
  82.  
  83. >Quick feed back (this we have)
  84.  
  85. An editable command history would be a very worthwhile addition.
  86. Another very worthwhile addition along these lines would be support for
  87. single character, user-definable "macro" words.  For instance "control-E"
  88. might put you in the editor (as opposed to having to type "E <return>".
  89. Alternatively, something like emacs' meta key could be supported.  Then
  90. "macro" words could be more than one character and would be launched
  91. automatically once enough characters were entered to uniquely identify
  92. the macro.
  93.  
  94. >A full system with all the options already loaded.
  95. This *might* get out of hand, depending on what you mean by "all the
  96. options."  I think an alternative idea might be a *very* reliable,
  97. *very* easy to use, full-screen "picklist" interface to words and
  98. extension wordsets.  Behind the scenes Forth would have a simple
  99. database which mapped requested words and wordsets to files and blocks
  100. and which, hopefully, also handled "unloading"/deleting words which
  101. were no longer needed.  What would it be like if, when you attempted
  102. to execute a word which wasn't in the dictionary Forth *automatically*
  103. loaded the word (perhaps with a warning to the user about what it
  104. was doing) and then proceeded on its way? 
  105.  
  106. >DOCUMENTATION; Use the resources of the machine!  The compiler
  107. >doesn't do anything with numbers above 127, so use control-C to
  108. >toggle the high-order bits to 1 and all incoming bytes are 128 or
  109. >above and are ignored by the compiler.  They can be used for
  110. >comments.  On the screen they're dimmer; the printer outputs then
  111.  
  112. >SO... a user could type FLO ALG SEQ at the forth prompt and be
  113. >using floating point, algebraic and sequential.  Type FIX RPN SCR
  114. >and you're a Forth purist.  Personally I don't care either way my
  115.  
  116. I think someone else already commented on the problem this would
  117. introduce with regard to some non-english languages.  However, you're
  118. certainly on the right track.  Having comments show up dimmed or in
  119. a different color would be be marvellous.  I've always been fond of
  120. the "shadow-screen" idea for comments, as well.  Having a short comment
  121. which could be expanded into an unlimited length "shadow" comment at
  122. the push of a key would be great and, possibly, unique.  You might
  123. find an idea such as this would attract a LOT of attention and
  124. admiration from users of other languages.  Documentation
  125. is a major programming problem.  Intermixing commments with code
  126. creates a visual clutter.  Distinguishing comments from code would
  127. , as I've said, help a lot.  Good support of shadow blocks would be
  128. a worthwhile extension of this idea.
  129.  
  130. >POWERFUL FEATURES that will help sell Forth.
  131. >
  132. >A usable link to C libraries and other black boxes. 
  133. >
  134. >The ability to run in background as an TSR.  Example call and run
  135. >
  136. >A trace function and a debugger called BUG  i.e. BUG <word> which
  137. >will work the same as DBG does..
  138. >
  139. >Typed values, Constants, and Variables were suggested at the
  140. >meeting but Jerry says are we sure?
  141.  
  142. YES.  The lack of robust variables (including local variables) and 
  143. structures is costing Forth a lot of users.  New users have to start
  144. programming somewhere and, I expect, many of them attempt to convert
  145. an existing program or algorithm to Forth and give up in frustration.
  146. In addition, data falls naturally into structures and I expect that
  147. the lack of C-equivalent structures is a major headache even for more
  148. advanced programmers.  I also suspect that the lack of
  149. types and structures is a major reason why we haven't seen more Forth
  150. applications.  
  151.  
  152. >We need feed back and implementations.  If you have an idea, or
  153. >opinion, write your self a note now, to call or write me.  If you
  154. ------
  155. IMO this is one of the most incisive list of suggestions I've yet seen
  156. on the net.  Forth is DYING, people.  I know some of you, such as JAX,
  157. take issue with that and argue about how well Forth is doing in 
  158. embedded applications but I disagree.  Forth may be doing well in
  159. embedded applications compared to, for instance, how poorly it is
  160. doing in all other areas but that is about it.  As memory continues to
  161. get cheaper Forth will be displaced from embedded applications, also.
  162. ANSI may help but it won't save Forth.  Only an influx of new programmers
  163. will save Forth and Forth is NOT going to get many new programmers unless
  164. it becomes much more standardized and becomes an order of magnitude easier
  165. to *LEARN*, USE, and WRITE commercially viable applications in.
  166.  
  167. I have a much better perspective on the problem than, perhaps, many of
  168. you because I can't program worth beans in Forth.  Rather than making
  169. me less qualified to comment on Forth I believe that makes me more
  170. qualified.  You see, Forth was one of the very first languages I
  171. attempted to use, dating back to early Fig (free) and LMI (commercial)
  172. Z80 Forths.  Over the years I've LEARNED numerous other languages and
  173. ATTEMPTED to learn numerous other Forths.  Some people, such as Mitch
  174. Bradley, apparently blame the plethora of "free" Forths for the problem
  175. but, IMO, they are mistaken.  I've tried commercial Forths, too, and
  176. my experience is that they are only slightly easier to learn and NO MORE
  177. PORTABLE than the free forths (I'm not talking here about portability
  178. within one particular vendor's products -- I'm talking about being able
  179. to take a program which runs under MS-DOS and get it to run under Unix
  180. or the Mac using *another* vendor's (or perhaps a PD) Forth.  That is
  181. the 'C' test for portability and it is the only test which
  182. matters.  Without this level of portability it becomes difficult or
  183. impossible for people to share code in the same way that C programmers
  184. can.
  185.  
  186. Forth programmers seem to be "hung up" on how fast their Forth kernel
  187. runs.  They don't seem to grasp the significance of the programming
  188. truism "First get it right.  THEN make it smaller, faster, slicker,
  189. etc."  They don't seem to recognize that speed of learning, speed of
  190. developing/modifying and speed of porting/maintaining are valid goals.
  191. IMO the latter are the MOST valid goals and without a new mindset which
  192. embraces them, Forth will continue its decline toward insignificance.
  193. Making "speed of execution" the God to which you sacrifice all other
  194. virtues has produced the phenomena where Forth programmers apparently
  195. write more Forth implementations than applications.  Mitch, Elizabeth,
  196. and other vendors decry the proliferation of Forths but none of them
  197. apparently want to follow their own advice.  If you REALLY want to
  198. help the Forth cause and have a successful company, Mitch, consider
  199. giving up your own Forth implementations in favor of creating good
  200. applications and tools which run portably on other vendor's
  201. implementations.  You sure won't have any competition.
  202.  
  203. The focus on execution speed at all costs ignores the facts that:
  204. (a) Forth is NEVER  going to be the fastest executing language.  There
  205. is too much money being spent by the 'C' vendors to continually
  206. optimize their compilers.  If you try to compete with 'C' on execution
  207. speed alone you are going to lose.  You might as well shoot yourself
  208. in the head and get it over with.
  209. (b) Speed of learning, developing applications, porting, and supporting
  210. are are areas where Forth likely *could* beat 'C' hands-down *if*
  211. Forth programmers would change their focus.  And, in the long run,
  212. many programmers and most companies care more about these time-wasting
  213. aspects of programs than they do about sheer execution speed. It's
  214. hard to run *anything* "slowly" on a 50 MHz 486.
  215. (c) If a user could *quickly* port a working version of a good
  216. application to his/her desired platform they would then be a much
  217. better mood and position to then go back and "optimize" it.  Give
  218. me a portable editor/database/game -- almost no matter how "slow" it
  219. runs -- and as I familiarize myself with the language and the code
  220. I will incrementally  improve its speed.  Give me a program which is
  221. a "speed-demon" on a particular vendor's particular Forth for a
  222. particular machine and you will, almost certainly, be giving me
  223. grossly non-portable, difficult to understand code.  And, rather than
  224. attempt the port, I will, almost certainly, throw it -- and Forth
  225. -- in the trashcan.  This is a very common experience with Forth.  The
  226. worst thing about having this happen is that people tend to carry a
  227. grudge and remember the language (not just the application or the
  228. implementation) which stung them.
  229.  
  230. I have a few final comments on the proposed "easy to learn" Fig Forth:
  231.  
  232. (1) worry only the Intel and Motorola families of processors but make
  233. the systems 100% compatible.  Do NOT sacrifice anything fundamentally
  234. important for the sake of the bottom of the line (i.e., 8088) processor.
  235. I just bought a 50 MHz 80486 with 8 megs RAM, a 200 MB harddisk and an
  236. SVGA monitor for $2200.  Anyone who doesn't value their time enough to
  237. upgrade from an 8088 now to, at least, a 386SX is unlikely to be an
  238. important convert to Forth.  If you are going to worry about them you
  239. might as well worry about the folks who are still using Timex
  240. Sinclairs.
  241.  
  242. (2) Make sure that source libraries are 100% portable.
  243.  
  244. (3) Make sure that you include powerful and easy to use string, file,
  245. and screen manipulation libraries.  It should be approximately as
  246. easy for a newcomer to concatenate two strings, files, or screen
  247. displays as it is to add two numbers.  Forth texts like to demonstrate
  248. the ease of use of the language by showing "3 5 + .".  They omit
  249. (or spend chapters) discussing how to do the equivalent string, file, 
  250. and screen operations.  Get a clue.
  251.  
  252. (4) Include with the libraries at least one or two "significant"
  253. applications which make wide use of the libraries and are 100% portable.
  254. As has been pointed out before, a portable and impressive editor, database,
  255. or video game would work wonders in promoting Forth.  The source code could
  256. be examined and adapted to numerous other applications.
  257.  
  258. I apologise if I've inadverently offended anyone or said anything which
  259. indicates my "ignorance" of Forth.  Let me end with a parting outrageous
  260. and gross generalization which likely, nevertheless, has a lot of validity:
  261. Change *Forth* to make *me* happy and you'll probably have done 95% of
  262. what needs to be done to give Forth a new lease on life.  The proposals
  263. made the Silicon Valley FIG are right on.  Those of you who
  264. significantly disagree -- no matter how well intentioned you may be --
  265. are the problem and you are strangling to death the language you profess
  266. to love.
  267. -- 
  268.  
  269. -----
  270. alan@tree.UUCP  or uunet!csusac!tree!alan
  271.