home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / forth / 3952 < prev    next >
Encoding:
Text File  |  1993-01-21  |  6.4 KB  |  164 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: <C18CFv.GtA@starnine.com>
  6. Sender: mikeh@starnine.com (Mike Haas)
  7. Date: Fri, 22 Jan 1993 00:38:18 GMT
  8. References: <1492@eouk9.eoe.co.uk> <C0ry23.8Dy@starnine.com> <1993Jan14.122149.16814@Informatik.TU-Muenchen.DE>
  9. Organization: StarNine Technologies, Inc.
  10. Lines: 152
  11.  
  12. In article <1993Jan14.122149.16814@Informatik.TU-Muenchen.DE> pazsan@Informatik.TU-Muenchen.DE (Bernd Paysan) writes:
  13. >
  14. >In article <C0ry23.8Dy@starnine.com>, mikeh@starnine.com (Mike Haas) writes:
  15. >|> Forth uses blocks because it was almost always used in embedded
  16. >|> controllers and on standalone computers which had little or no
  17. >|> operating system.
  18. >
  19. >Oups, there were no embedded controllers with disk access in the early
  20. >70th. Correct me, if I'm wrong. But in front of me is a disk from '69,
  21. >with a nice headcrash and it's about 40".
  22.  
  23. So?  BLOCK doesn't have to access a disk.  The original FIG listings
  24. references RAM like screens... I saved these screens to tape until
  25. I managed floppy access.
  26.  
  27. And yes, there WERE standalone CPU boards with not only floppy connectors,
  28. but ST506, also.
  29.  
  30. >
  31. >|> It is nuts to suggest that blocks were implemented because they were
  32. >|> thought superior to text files and to do so is rewriting history.
  33. >
  34. >Did you ever see this cards with little holes? THEY were the first mass
  35. >storage. And they were treated as STREAMS. The invention of blocked mass
  36. >storage is back to the first disks. Don't rewite history: stream is the
  37. >elder concept. Blocked IO is newer.
  38.  
  39. I didn't say which was newer.  I simply stated that BLOCKS did not
  40. happen because they were judged better than files for the same
  41. implementations.  They came about to support development on non-file-
  42. based systems.  That is their targeted environment, but using them
  43. in a file-system is done at considerable cost.
  44.  
  45. Blocked I/O was developed to allow Forth to operate on any
  46. environment that had any sort of mass storage, specifically to
  47. facilitate development on non-file-based systems.
  48.  
  49. It is also a conceptually simple way to have the same interpreter
  50. work from the keyboard and mass storage (although this is not at all
  51. difficult to do with files, either).
  52.  
  53. >
  54. >|> Not at all.  Simply change the interpreter such that it considers
  55. >|> the end-of-line character or sequence to be another blank character.
  56. >|> (y'know... the unconditional delimeter, most consider TAB, too).
  57. >|> 
  58. >|> That's 99% of what's needed to get a Forth to work with
  59. >|> files.
  60. >
  61. >And what if a word in a stream file is split over two IO blocks? You
  62. >either have to read all the file at once in one big block (good for small
  63. >files, bad for large ones) or realy to parse for end-of-line.
  64.  
  65. Yes, parsing for end-of-line is the whole point (that was the gist of
  66. the above statement by me).  Having real end-of-line parsing is
  67. a boon, especially when writing Forth programs that have to
  68. deal with files produced by other STANDARD OS apps.
  69.  
  70. >
  71. >|> Not using text files will indeed insure that many folks will never use
  72. >|> any Forth tools.
  73. >
  74. >Many folks never will use any Forth tools anyway. Many folks even don't
  75. >know the difference between WinWord format and plain ascii text (the
  76. >Windows user who tries to change WIN.INI with WinWord is a typical
  77. >example).
  78.  
  79. But many folks use WIndows.  And C.  And Pascal.  And assembly.  And ....
  80. But not Forth.
  81.  
  82. BLOCKS, I feel, are one reason why.
  83.  
  84. >
  85. >Using text files in big Forth systems (like JForth, bigFORTH or F-PC) is
  86. >certainly a good idea.
  87. >
  88. >|> Forth is not an operating system.  It provides an execution
  89. >|> environment on standalone computers, but it is no operating system.
  90. >|> Nothing but Forth can operate under it's auspices.
  91. >
  92. >I always thougt an execution environment IS an operating system.
  93. >Otherwise you should call MS-DOS not to be an operating system.
  94. >
  95. >The typical Forth as OS provides: Terminal and Disk IO, Multitasking and
  96. >a way to load and execute programs. 
  97.  
  98. The disk I/O is normally only BLOCKs.  With no concept of a file, it
  99. is a useless operating system.
  100.  
  101. Those "programs" must be in Forth SOurce form.  This is a Forth
  102. environment, NOT an operating system.
  103.  
  104. >It hosts editors, the Forth compiler
  105. >(and sometimes other compilers like Forth cross compilers or tiny Pascal
  106. >or tiny Basic and so on).
  107.  
  108. Only Forth code is "hosted".  Forth is not an operating system.
  109.  
  110. >Some Forths even have ways to save applications
  111. >as binary and reload them very fast (i.e. my bigFORTH). These Forths even
  112. >provide something an Unix would call "Shared Libraries". A host of Forths
  113. >provide multiuser abilities.
  114.  
  115. It is still a Forth-only environment... NOT an operating system.
  116.  
  117. >
  118. >MS-DOS only provides Terminal and Disk IO and a way to execute programs.
  119. >And even that is not true, look at the bulk of DOS-Externders for any
  120. >useful program...
  121.  
  122. I'd agree that MSDOS is extremely limited and may not qualify as
  123. a true OS.  It provides no GUI facilities, resource tracking, but
  124. still is a GENERALIZED environment.
  125.  
  126.  
  127. >
  128. >|> Usre of blocks in no way increases one's efficiency.  In fact, it hinders it
  129. >|> because you have to develop all your own print software, backup software,
  130. >|> stuff that normal OS files live easy with.
  131. >
  132. >Per file backup should work. And to port print software you have already
  133. >is an easy task.
  134.  
  135. And write some that doesn't is less easy.  And to write a 'diff' utility
  136. for screens is even less easy.  Sooner or later, you're going to get
  137. to something that's hard!
  138.  
  139. Seriously, even DOS provides this stuff for text files.  Why have to
  140. re-invent it at all?  And when improved versions of DOS (or your text editor
  141. or print spooler or ... ) appear, you will benefit by default.
  142.  
  143. >
  144. >|> It's a helluva lot easyier to insert a new function in the middle of
  145. >|> your program with files.
  146. >
  147. >bigFORTH:
  148. >Alt I and a new screen is inserted at the actual position. Alt D and one
  149. >is deleted. Even with long screen files it's fast on a HD.
  150.  
  151. Text files:
  152. Press RETURN and a new line is entered.  You don't have waste 1023
  153. characters to get that new line, either.
  154.  
  155. BTW, this idea of "inserting" a screen may apply to BigForth, but
  156. not in most of them.  In fact, it's those Forths that use
  157. screens-within-files that provide this capability.  And it's the
  158. fact that there's a FILE SYSTEM underneath that allows you to do this!
  159.  
  160. Just go the next logical step and throw away the BLOCK layer.  There's
  161. no reason for it on file-based platforms, and it's continuance
  162. hurts Forth.
  163.  
  164.