home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / forth / 3756 < prev    next >
Encoding:
Text File  |  1993-01-04  |  5.1 KB  |  110 lines

  1. Newsgroups: comp.lang.forth
  2. Path: sparky!uunet!spool.mu.edu!torn!mcshub!rob
  3. From: rob@innovus.com (Rob Sciuk)
  4. Subject: Re: Forth for Sparc and other Unix based computers
  5. Message-ID: <1993Jan4.171143.8445@mcshub.dcss.mcmaster.ca>
  6. Sender: usenet@mcshub.dcss.mcmaster.ca
  7. Nntp-Posting-Host: alpha.innovus.com
  8. Organization: Innovus Inc., Hamilton, Ontario, Canada
  9. References: <1i20irINNecr@life.ai.mit.edu> <BEVAN.93Jan1223716@panda.cs.man.ac.uk> <1i7l8oINNcgj@life.ai.mit.edu>
  10. Date: Mon, 4 Jan 1993 17:11:43 GMT
  11. Lines: 97
  12.  
  13. In article <1i7l8oINNcgj@life.ai.mit.edu> mikc@hal.gnu.ai.mit.edu (Mike Coughlin) writes:
  14.  
  15. [deletion]
  16.  
  17. >:
  18. >:      There are versions of Forth that are designed to run on any Unix 
  19. >:   workstation. They are written in "C" for portability. For a "free" one,
  20. >:   try TILE from the GNU collection of programs. Of course you will have
  21. >:   to spend time instead of money compiling it and getting it to work.
  22. >:
  23. >:It compiles without a glitch on a SPARC, but it fails the second
  24. >:criterion i.e. it isn't a _native_ code FORTH.  If you are wondering
  25. >:why it has to be native, see the message I was responding to (back on
  26. >:the 9th of Dec).
  27. >:
  28. >     Right, its not native code. But the trouble is that the SPARCstation
  29. >is a Unix box. And Unix works with C. So if you want a native code
  30. >anything on a Unix box you'll have trouble with the documentation. The
  31. >documentation tells you how to write C programs, but finding what you
  32. >need for native code from an assembler is not easy. I've looked and
  33. >I don't know where to find it for any of the Unix boxes I have access
  34. >to. For all I know some companies might consider it to be a trade secret.
  35. >I haven't noticed any Forth systems for Unix boxes that were not written
  36. >as C programs.
  37.  
  38. Most C compilers support the -S option of to generate the ASSEMBLY code 
  39. necessary to perform the OS task required.  Write it in C, look at the
  40. assembly, and use that as a model.
  41.  
  42. BUT:
  43.  
  44. As you are probably aware, there are several schools of thought 
  45. regarding FORTH.  Some regard FORTH as a language, others as an
  46. operating system/language.  
  47.  
  48. When FORTH is `hosted' on an operating system such as Unix, which may 
  49. either be a workstation, or a multiuser minicomputer, it is generally 
  50. a good idea to use the standard system interface for I/O, scheduling, 
  51. interrupts etc. or risk crashing your general purpose OS.  In this 
  52. context, FORTH becomes a language only.
  53.  
  54. On a single user platform, such as MSDOS or Windoze on Intel based
  55. boxes, either approach is viable:
  56.  
  57.     o  If you want to develop device drivers, interrupt handlers, etc, 
  58.     the only one you nuke is yourself, and a <ctrl alt del> (or more likely
  59.     a power off/on) can bring you back to sanity (or at least DOS ;-).
  60.  
  61.     o  If you want to use MSDOS routines, or files ... you can
  62.  
  63.     o  If you want to write to the BIOS, or even the hardware directly,
  64.     you can develop the whole OS etc.  and have your Intel box boot 
  65.     FORTH (or whatever you call your own particular nightmare) with 
  66.     block based file systems etc.
  67.  
  68. When using big iron, with multiple users, the standard C interface to the
  69. system calls can be ignored, and you can make system calls directly -- if
  70. you know how, and specifically on your target platform, and at your own risk.
  71.  
  72. Assembly language implementations of FORTH under Unix may give a slight speed 
  73. advantage over C based routines, but in (most?) I/O intensive applications, 
  74. you will still be constrained by the OS itself.  What you gain in performance
  75. (slight) you lose in portability.
  76.  
  77. >     Lets hope somebody who knows how to program a SPARKstation or other
  78. >Unix box down to the bare metal will enlighten us all. 
  79. >
  80. >-- 
  81. >   Michael Coughlin             mikc@gnu.ai.mit.edu  
  82.  
  83. So what is it that you want?  A SPARC based stand alone FORTH system, or a
  84. general purpose Un*x OS that can run FORTH applications?  If you need real
  85. time FORTH, consider using an Intel platform and one of the commercial native
  86. (non-hosted) variants that are out there.  If THAT isn't fast enough, throw out
  87. your OS, get the hardware reference manual for your RISC platform (if you can),
  88. a cross development environment, an assembler, and start hacking (have fun ;-).
  89.  
  90. My own C based FORTH is based on the Forth-83 standard, and runs unchanged on 
  91. just about every platform that has a K&R C compiler, and that I have intimate 
  92. access to (MPE/V, MPE/XL, HP-UX (MC68K and PA-RISC), MSDOS, etc).  FORTH 
  93. applications run transparently across each implementation.  AND it's fast
  94. enough (for me).  
  95.  
  96. In addition, I have successfully linked OS libraries 
  97. into my FORTH to give interactive development for such things as DBMS's,
  98. GUI's, memory allocation, etc. on a platform specific basis (great for
  99. prototyping without C's compile/link/edit cycle).
  100.  
  101. I would suggest that all of the features of my roll_your_own are also true with 
  102. TILE, and it has the added advantage of a larger installed base.
  103.  
  104. Assembly bigots take note -- elegance has many forms.
  105. -- 
  106. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  107. Rob Sciuk       rob@innovus.com OR rob@innovus.on.ca
  108. Innovus Inc.    204-200 James St S. Hamilton, Ont.      Phone:  (416) 529-8117
  109.                 {not a flame ... merely a glimmer ...}  Fax:    (416) 572-9586
  110.