home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / forth / 3973 < prev    next >
Encoding:
Text File  |  1993-01-23  |  2.7 KB  |  66 lines

  1. Newsgroups: comp.lang.forth
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!sol.ctr.columbia.edu!venezia!penev
  3. From: penev@venezia (Penio Penev)
  4. Subject: Recent FORTHs' guts  (was: Documenting)
  5. References: <1993Jan22.232144.8420@murdoch.acc.Virginia.EDU>
  6. Sender: nobody@ctr.columbia.edu
  7. Organization: Rockefeller University
  8. Date: Sat, 23 Jan 1993 12:27:39 GMT
  9. X-Newsreader: TIN [version 1.1 PL6]
  10. Message-ID: <1993Jan23.122739.24899@sol.ctr.columbia.edu>
  11. Reply-To: penev@venezia.rockefeller.edu
  12. X-Posted-From: venezia.rockefeller.edu
  13. NNTP-Posting-Host: sol.ctr.columbia.edu
  14. Lines: 50
  15.  
  16. Julian V. Noble (jvn@fermi.clas.Virginia.EDU) wrote:
  17. : Review of HS/Forth
  18. : I have used HS/Forth since version 1.x, which I acquired sometime
  19. : in 1984. It has grown to be a very complete system with all sorts of
  20. : utilities, libraries, etc. included. A late version (that I have not
  21. : yet tried) includes a DOS extender and can therefore address a 32-bit
  22. : flat memory space with reasonable speed (i.e. not swapping it in and out
  23. : of 64K buffers below in the top of the first 1 Meg).
  24. : Although I have not personally done any of this, Callahan provides
  25. : interfaces to C and other compiled programs. This lets you use
  26. : commercial C libraries, e.g., for graphics, etc.
  27. : Finally, most of the kernel (code primitives) is very slick and semi-
  28. : optimized. Ex: the BX register is used as TOS, hence @ is just
  29. :     CODE  @   BX [BX] MOV.  END-CODE
  30. : Note also that Callahan does the obvious, incorporating NEXT in
  31. : END-CODE. I was a bit surprised to see fairly recent Forths that do
  32. : not do this.
  33.  
  34. I think, that when one designes a FORTH for a machine with a lot of
  35. memory, native code is the better way. It's faster, while not wasting
  36. much. On a i386 one have 4-byte 'address' and a 5 byte 'call address'.
  37. Well, it's not like having 15 bit 'address' and 16 bit 'call address'
  38. like in RTX, but it's still tolerable.
  39.  
  40. Another consideration is when You run RISC processors (I'm running
  41. R3000 currently). There You have even more space and You can benefit
  42. _a lot_ from the inlining of some primitives. The call on this
  43. processor cannot be made less that 2 instructions (read 2 clocks and 8
  44. bytes). But the You have something like this for the @ , TS being top
  45. of stack :
  46.  
  47. : @   TS ) TS lw  ; IMMEDIATE  
  48. : @   @ ;
  49.  
  50. I even developed a 8051 FORTH, (polyFORTH - like) that used native
  51. calls and inlining. It performed about the speed of some old 8088
  52. FORTHs. The good thing there is that one has near (2K) calls, which
  53. compile to 2 bytes instaed of 3. With well structured applications the
  54. tendency is to make near calls. There one can use phrases like
  55.  
  56. : AWORD  FORTH WORDS [ assembly operators ] OTHER FORTH WORDS ;
  57.  
  58. Great for controlling devices. _Fast_.
  59.  
  60. Flames welcome.
  61.  
  62. -- Penio.
  63.