home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / misc / 3634 < prev    next >
Encoding:
Text File  |  1992-11-13  |  2.9 KB  |  64 lines

  1. Newsgroups: comp.lang.misc
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin
  3. From: hrubin@pop.stat.purdue.edu (Herman Rubin)
  4. Subject: Re: languages which allow the introduction of new operators
  5. Message-ID: <Bxns5v.5uJ@mentor.cc.purdue.edu>
  6. Sender: news@mentor.cc.purdue.edu (USENET News)
  7. Organization: Purdue University Statistics Department
  8. References: <17434@mindlink.bc.ca>
  9. Date: Fri, 13 Nov 1992 14:27:30 GMT
  10. Lines: 52
  11.  
  12. In article <17434@mindlink.bc.ca> Nick_Janow@mindlink.bc.ca (Nick Janow) writes:
  13. >hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  14. >
  15. >> But I would object to any language which insists that we use a strictly
  16. >> stack machine.  Pushing, popping, and calling are to be avoided unless
  17. >> necessary. Otherwise things just run too slowly to be of more than
  18. >> theoretical use.
  19.  
  20. >Why do you object to the use of a stack machine (on which those operations
  21. >are fast)?  If a stack language on a stack machine will run n times as fast
  22. >as a non-stack language on a non-stack machine of equal technology level, why
  23. >not use a stack machine?
  24.  
  25. >Don't some languages insist (for reasonable performance) that the processor
  26. >provide registers and addressing modes?
  27.  
  28. HOW can a stack machine be fast?  One of the features of an efficient program
  29. is to have the quantities needed available in registers.  A dozen or two
  30. registers are usually needed to get decent performance, and often it would
  31. help to have hundreds.  On of my friends in the computing center here tells
  32. me that the 256 registers on the CYBER 205 (more than 220 not tied up by
  33. system operations) is not always enough.
  34.  
  35. But code such as push x; push y; push procedure Z; execute; pop result to w;
  36. will not execute fast compared to 
  37.         
  38.     w = x Z y,
  39.  
  40. where registers are used.  Also, efficient programming should take into account
  41. which addressing modes are available.
  42.  
  43. >> Getting any speed out of machines requires that we think of speed in
  44. >> coding, rather than the fact that it is possible in principle to operate
  45. >> with a stack machine with no registers.  This also ignores hardware, such
  46. >> as vector machines, where the use of a control register or control stream
  47. >> introduces basic bit operations which did not exist before, and which are
  48. >> utterly stupid as a means of efficient computation on a stack machine.
  49.  
  50. >There's no reason why special hardware can't be added to a stack machine.
  51. >You could, for example, add a pair of FIFO "stacks", which might be useful
  52. >for signal processing operations.
  53.  
  54. It will still not help if more versatile register-type operatations are
  55. appropriate.  
  56.  
  57. There is an ongoing discussion in comp.arch of the advantages and disadvantages
  58. of stack machines.  
  59. -- 
  60. Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
  61. Phone: (317)494-6054
  62. hrubin@snap.stat.purdue.edu (Internet, bitnet)  
  63. {purdue,pur-ee}!snap.stat!hrubin(UUCP)
  64.