home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / forth / 3744 < prev    next >
Encoding:
Text File  |  1993-01-02  |  4.3 KB  |  96 lines

  1. Newsgroups: comp.lang.forth
  2. Path: sparky!uunet!paladin.american.edu!gatech!swrinde!ringer!news
  3. From: braker@ennex5.eng.utsa.edu (Jim Brakefield)
  4. Subject: Re: Forth FAQ Answers: Part 01 (What is Forth?).  (V1.0:01.Jan.93)
  5. Message-ID: <1993Jan2.181428.22141@ringer.cs.utsa.edu>
  6. Keywords: Forth, software metatheory, address space
  7. Sender: news@ringer.cs.utsa.edu
  8. Nntp-Posting-Host: ennex5.eng.utsa.edu
  9. Organization: Univ of Texas at San Antonio
  10. References: <4215.UUL1.3#5129@willett.pgh.pa.us>
  11. Date: Sat, 2 Jan 1993 18:14:28 GMT
  12. Lines: 82
  13.  
  14. In article <4215.UUL1.3#5129@willett.pgh.pa.us>  writes:
  15. > What is Forth?
  16. >  (C) Copyright 1992 by Philip J. Koopman Jr.
  17. >  Original message header:
  18. >     From: koopman+@cs.cmu.edu (Philip Koopman)
  19. >     Summary: HOPL-II Forth language description -- Draft 9/17/92
  20.  
  21. >  The following is a draft description of the Forth
  22. >  programming language.  It will eventually appear as 
  23. >  a preprint for the History of Programming Languages 
  24. >  Conference (HOPL-II) to be held in Boston in April 1993.
  25. >  That conference will feature an excellent paper on the 
  26. >  history of Forth by Rather, Colburn & Moore.
  27. >  Constructive criticism appreciated.
  28.  
  29. >  Forth is both an extensible language and an interactive program 
  30. >  development methodology.  While originally developed for small 
  31. >  embedded control mini- and micro-computers, Forth seems to have 
  32. >  been implemented on every major processor manufactured.  It has 
  33. >  been used in a wide variety of applications, such as spreadsheets, 
  34. >  expert systems, and multi-user databases.
  35. >  At the most superficial level, Forth is an almost-directly executable 
  36. >  high-level language for a stack-based abstract machine.  In its 
  37. >  essential form, the Forth abstract machine has a program counter, 
  38. >  memory, ALU, data evaluation pushdown stack, and subroutine return 
  39. >  address pushdown stack.
  40.  
  41. I wish to comment on Forth as an abstraction of computer programming.
  42. That is: the use of Forth to model other software paradigms.  Granted
  43. Forth is primarily a practical language or tool, I see no harm in also
  44. considering it a theoretical vechicle.
  45.  
  46. I choose Koopman's description of the normal-perception-of-Forth as a
  47. point of departure.  The metatheory goes something like:
  48.     Justification of the architecture
  49.     Properties of the architecture
  50.     Embeddings of other software paradigms
  51.  
  52.     Signal space (Boolean logic, gates, & flip-flops) provide the
  53. material for building computers.  Computers are an actual means of 
  54. evaluating expression trees.  Thus the hardware is arranged to provide
  55. a suitable means for expression evaluation (i.e., computation).
  56.  
  57.     Memory is the means to encode the expression tree and its
  58. run-time support.  Memory is an ordered set of states (memory locations).
  59.  
  60.     The complete expression tree is folded to save memory.  This
  61. folding (factoring) is via recursion (iteration is a specific form of
  62. recursion, i.e., tail recursion).
  63.  
  64.     Given that the expression tree is evaluated sequentially, the
  65. dynamic state information can be ordered into a stack.  However it is
  66. better to provide two stacks: a data stack and a return address stack.  
  67.  
  68.     The return stack is seperate from the data stack in that it 
  69. encodes locations in the expression tree and that it is handy to rewrite 
  70. the expression tree (refactor) as part of the software development process 
  71. (the expression tree does not appear all at once, but must be created
  72. and tested a portion at a time).
  73.  
  74. The above is a minimal statement of a rational for why computers and their
  75. software environments are the way they are.  Several things emerge:
  76.  
  77.  Memory economy leads to recursive expression of software.
  78.  The von-Neuman or sequential evaluation mode leads to evaluation stacks.
  79.  The need to refactor the expression tree leads to seperating the data
  80.   and return stacks.
  81.  
  82. It is a little surprising some of the most "glorious" concepts in computer
  83. science have such humble ancestrey: Recursion is a result of the need to
  84. conserve memory, sequential evaluation favors the stack, and the oldest
  85. debugging kluge in the books, splicing in a modified piece of code via
  86. replacing the code with a subroutine call, leads to seperating the 
  87. evaluation stack into data and return stacks.  (pardon my sinicisum)
  88.  
  89. Anyway, I welcome discussion on the above, terse as it is.
  90.  
  91. James Brakefield, braker@ennex1.eng.utsa.edu
  92. Hopeless Forth theoretician
  93.  
  94.