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

  1. Newsgroups: comp.lang.forth
  2. Path: sparky!uunet!starnine!mikeh
  3. From: mikeh@starnine.com (Mike Haas)
  4. Subject: Re: Documenting
  5. Message-ID: <C1JoxC.FuK@starnine.com>
  6. Sender: mikeh@starnine.com (Mike Haas)
  7. Date: Thu, 28 Jan 1993 03:41:34 GMT
  8. References: <1993Jan14.122149.16814@Informatik.TU-Muenchen.DE> <C18CFv.GtA@starnine.com> <1993Jan22.105759.20424@Informatik.TU-Muenchen.DE>
  9. Organization: StarNine Technologies, Inc.
  10. Lines: 244
  11.  
  12. In article <1993Jan22.105759.20424@Informatik.TU-Muenchen.DE> pazsan@Informatik.TU-Muenchen.DE (Bernd Paysan) writes:
  13. >
  14. >me>It hosts editors, the Forth compiler
  15. >me>(and sometimes other compilers like Forth cross compilers or tiny Pascal
  16. >me>or tiny Basic and so on).
  17. >
  18. >MH>Only Forth code is "hosted".  Forth is not an operating system.
  19. >
  20. >Forth + tiny Basic HOSTS basic. You can do SAVESYSTEM or save tiny basic
  21. >as an binary application. Many operating systems hosts only native code.
  22. >You can't call this: "Only native code is hosted". As soon as you host
  23. >native code (it doesn't matter if it's the native code of the real
  24. >machine or of any virtual machine), you host everything. My Forth hosts
  25. >native code - so it hosts everything.
  26.  
  27. I don't know Tiny Basic, but I stand by my statement that Forth
  28. only runs Forth code.  You may be able to support some subset of BASIC
  29. but it has never occured that a Forth supported all of Basic or any
  30. other language.
  31.  
  32. Forth is a hacker's dream which allows a tremendous amount of low-level
  33. control of the hardware it runs on.  It is in no way a general-purpose
  34. environment designed to support the widest possible range of applications
  35. in an easy, convienient manner.
  36.  
  37. It provides no memory management above and beyond the simplistic
  38. dictionary model, and it's standard I/O services it has to
  39. offer are next to nil.  Device-independance is almost an
  40. unknown concept in Forth; standard Forth only includes 2
  41. devices (a console & a disk) without any standard means
  42. of expanding the capabilities.
  43.  
  44. It offers no industry-standard way of managing basic text, much
  45. less graphics objects, sound objects, animation objects.
  46.  
  47. I will admit that Forth can be made to do almost anything, but
  48. once you've added that to a particular Forth, there will be no
  49. other applications that operate under your "system".
  50.  
  51.  
  52. >
  53. >me>Some Forths even have ways to save applications
  54. >me>as binary and reload them very fast (i.e. my bigFORTH). 
  55.  
  56. Again, only Forth code.  Operating systems are language-independant.
  57.  
  58. >These Forths even
  59. >me>provide something an Unix would call "Shared Libraries". A host of Forths
  60. >me>provide multiuser abilities.
  61.  
  62. These are not necessary for an operating system, many have existed
  63. without libraries or multitasking.  There are even UNIX environments
  64. which are single-user.
  65.  
  66.  
  67.  
  68. >
  69. >MH>It is still a Forth-only environment... NOT an operating system.
  70. >
  71. >Stop with this. Repeating it makes it not more true. You can load Tiny
  72. >Pascal (I didn't port it, so you have actually some work to do), and then
  73. >you can compile pascal programs and save them as binaries.
  74.  
  75. You can support a subset of the pascal syntax.  That does not mean
  76. you are compiling Pascal programs and it doesn't mean Forth is an
  77. operating system.
  78.  
  79. When you can leave off the "tiny" in those statements, and start
  80. fully supporting other languages and applications, you will
  81. have the rudiments of an operating system.
  82.  
  83. Forth is no more an operating system than any other interactive
  84. programming language.  After all, that's what it is, an interactive
  85. programming language.  And not even a very good general-purpose
  86. one at that.
  87.  
  88.  
  89. >You can start 
  90. >them up, they will link at load time (just as MS Windows' dynamic linking) 
  91. >and they will run. The parameter passing to system routines is a bit 
  92. >different from other Pascal compilers, but that's not the point. The 
  93. >feature of saving part of the application as binary and reload it later is 
  94. >not uniq to my bigFORTH. To the common definition, bigFORTH is just as 
  95. >much an operating system as Unix. Unix is NOT a C-only OS, although you 
  96. >have to use much of the C environment to start up any program (either C 
  97. >hosted or with the C linker /bin/ld linked).
  98.  
  99. The programs your 'bigForth' runs were all compiled with your 'bigForth'
  100. compiler.  There are Forth's that were written in other languages
  101. but that doesn't make that original language an operating system.
  102. In fact, such Forth's can easily support the entire Forth syntax,
  103. and does not need a 'tiny' pre-pended to it's name at all.
  104.  
  105. And to correct your statements about Unix... A non-C program can run
  106. under Unix without C entering the picture at all.  That program
  107. will probably have to access Unix shared-libraries to accomplish
  108. I/O and the like, but that shared library may or may not have
  109. been written in C.
  110.  
  111. >
  112. >Things from Unix missing in bigFORTH: Own file system (there is only a
  113. >file interface - but NFS is only an interface, too), no virtual memory
  114. >management and some task and network i/o features aren't implemented.
  115. >That's not the point. There is even a true NFS from Ewald Rieger who
  116. >ports bigFORTH to his 68k microcontroller. bigFORTH boots from any
  117. >sequential source, ROM or file, as you like it.
  118.  
  119. Whatever you bring your Forth or any other Forth up on, however it boots,
  120. whatever it does, it myopically only supports compiled Forth code.
  121.  
  122. At the very best, it might be called a Forth operating system.  But
  123. still, it's only an interactive programming language.
  124.  
  125. I feel strongly about this because it's one of the reasons Forth is
  126. so strongly rejected by professionals who KNOW operating systems,
  127. other languages, real-world uses for computers.  Loud
  128. claims that Forth is an operating system is dismissed as so
  129. much hype, and wisely so.
  130.  
  131. In my mind, the Forth community needs to spend more time figuring out how
  132. to get Forth to LIVE EASILY under real existing operating systems.
  133. Throw out blocks would be a good start.  Instead, Forthers commonly
  134. blast C and other languages (all of which are profoundly more
  135. successful that Forth) and spout off hype like "Forth is an operating
  136. system unto itself!  It's better than any garbage anywhere!..."
  137. on and on ad nauseum.
  138.  
  139. All of it turns away non-Forthers.
  140.  
  141. >
  142. >The nonexistence of C compilers or so for bigFORTH has it's reason because
  143. >bigFORTH isn't a very widespread OS and none of my user needs C programs
  144. >hosted by bigFORTH :-).
  145.  
  146. Without even a file system, you could not produce a C compiler
  147. in your Forth.  You would need libraries, a linker, make facility...
  148. Of course, you could run under a real operating system to
  149. provide these things, but that's sort of self-defeating to your
  150. argument.
  151.  
  152.  
  153. >
  154. >MH>Just go the next logical step and throw away the BLOCK layer.  There's
  155. >MH>no reason for it on file-based platforms, and it's continuance
  156. >MH>hurts Forth.
  157. >
  158. >I have some applications using the BLOCK layer, including the ability to
  159. >read stream files. If I cut out the BLOCK layer, no file interface will
  160. >work.
  161.  
  162. Not true.  JForth completely interfaces with the native AmigaOS,
  163. and it's vector for BLOCK is not even initialized.  That doesn't
  164. happen until someone compiles in the BLOCK code (which I
  165. don't think any of my users do).
  166.  
  167. >BLOCKs are the right primitive to implement any sort of disk I/O.
  168.  
  169. No, under a normal OS, it's primitives are the right ones, and
  170. there is no reason to implement BLOCK because:
  171.  
  172.    1. Many disk ops read/write MUCH less than 1024 bytes.
  173.    2. OS's provide their own block-style buffering and usually
  174.       in chunks less than 1024 bytes.
  175.  
  176. >And I never will cut out the primitive under my block layer: It's part of
  177. >my memory management that allows to read arbitrary parts of a file as
  178. >purgeable memory block.
  179.  
  180. Now THAT's the kind of service an operating system provides.  And you're
  181. taking advantage of it in your Forth.
  182.  
  183. >The block layer in between are two one-liners.
  184. >
  185. >Some of my files are quite large (the kernal i.e.). I don't want to wait
  186. >seconds or more to edit one line in a file. I like structuring programs
  187. >into screens - I do so even in stream files. I have a nice editor allowing
  188. >both screen- and streamfiles. I think it's a matter of taste and my users
  189. >have different tastes. The newer Forth users tend to use stream files, the
  190. >elder stay with screen files. I don't want to reduce my market by throwing
  191. >things out many users use and like. The market is small enough.
  192.  
  193. And it will stay that way.
  194.  
  195. >
  196. >MH>It not only saves a tremendous amount of disk space over blocks, but
  197. >MH>is still in a format that is interpretable...you don't have to
  198. >MH>PKUNZIP it first.
  199. >
  200. >I've a 50 MB hard disk. du F:\bigforth gives about 5 MB. This is not
  201. >tremendous - one third of this are binaries, GEM resources, dupes and
  202. >old projects. Forth sources are so compact, if in screens or streams,
  203. >wasting 50% of the space doesn't matter much - projects are still much
  204. >shorter than C sources.
  205.  
  206. It'll make a difference when you fill that 50MB up.  Then the 50%
  207. of space wasted in those BLOCKS will seem more important.
  208.  
  209. This is the kind of attitude that the "progressives" in this
  210. newsgroup mention often... justification of why the "waste" of BLOCKS
  211. is not important, or why it's OK for Forth source to be in a format
  212. that is completely alien to the host OS.  Rationalization run rampant.
  213.  
  214. >
  215. >MH>But with some of the arguments I've witnessed here for BLOCKS, I wouldn't
  216. >MH>be surprized if someone proposed coding PKUNZIP in the interpreter to
  217. >MH>expand zipped SCEENS for interpretation.
  218. >
  219. >:-) One of my users proposed something like this at the last FORTH
  220. >Gesellschaft e.V. meeting. He said he'll try to implement it, but I never
  221. >heard again ;-).
  222.  
  223. I'm not surprised.  Anything to keep from doing it in an industry-
  224. approved manner.
  225.  
  226. >
  227. >But tell me: why do screens hurt Forth if you can use stream files if you
  228. >want?
  229.  
  230. Because they are so damn prevalent.  That's all that PD Forths support,
  231. and after all, the file interface spelled out by dpANS is
  232. *optional* is it not?  What wordset does BLOCK appear in?
  233. This topsy-turvy heirarchy insures that BLOCKS stay visible to
  234. newbies, and that's one of the things that is killing this language
  235. in the general market.
  236.  
  237. >The most unpopular feature of Forth is the postfix notation. Why
  238. >don't you start a flame war against this :-). It's realy not difficult to
  239. >build an infix compiler for Forth (2 screens - or 32 lines, if you like
  240. >that more :-).
  241.  
  242. Because there isn't anything about RPN that has been outmoded by another
  243. technology and there is nothing inherent in it's use that hinders
  244. the actual operation of Forth as a general purpose language.  It
  245. actually is advantageous in an interactive environment, and is
  246. architecturally well-fitted to the Forth interpreter.
  247.  
  248. None of these things are true about blocks.
  249.  
  250. The perception that RPN is a bad thing is in error, and RPN is
  251. defensible on several fronts, among which it it's use in the
  252. industry, probably the most well-known example is HP.
  253.  
  254. The perception that BLOCKs are a problem is accurate.
  255.  
  256.