home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / forth / 4017 < prev    next >
Encoding:
Text File  |  1993-01-28  |  6.1 KB  |  143 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: <C1JtH6.G3B@starnine.com>
  6. Sender: mikeh@starnine.com (Mike Haas)
  7. Date: Thu, 28 Jan 1993 05:19:52 GMT
  8. References: <C18CFv.GtA@starnine.com> <1993Jan22.105759.20424@Informatik.TU-Muenchen.DE> <1jp5u1INNsam@transfer.stratus.com>
  9. Organization: StarNine Technologies, Inc.
  10. Lines: 131
  11.  
  12. In article <1jp5u1INNsam@transfer.stratus.com> nick@sw.stratus.com (Nicolas Tamburri) writes:
  13. >
  14. >What has fanned these flames are
  15. >those who advocate that block are the only way to go, and stream files are an
  16. >abomination to Forth.  (Although I believe it was MH who set fire to it all with
  17. >an incindiary message about how screens should go the way of the dinosaur.
  18. >Apologies beforehand if I'm wrong Mike.)
  19.  
  20. I believe you're right.  And we've been having fun ever since.
  21.  
  22. And what a surprise... BLOCK is still in Forth and files, at best,
  23. are optional.  Who'da thunk it?
  24.  
  25. I understand that BLOCKs will always be in Forth.  In the embedded
  26. controller arena, they are necessary!  (well, at least they seem to
  27. be the simplest answer to the mass-storage problems in such situations.)
  28.  
  29. And I used them myself for years when I used my homebrew machine  
  30. running Fig-Forth.  But my partner and I (it was multi-user) still
  31. found them so abhorent to use that we developed a file system
  32. on top of them.  Anyone could do it... only took a few weeks and
  33. we were doing DIR listings.
  34.  
  35. (BTW...yes...I can hear it...when was Fig-Forth multi-tasking, much
  36. less multi-user?  Well, the writers of the 6800 Fig-Forth, and
  37. probably all, had included the 3 USER variables you needed
  38. to support multitasking, they just didn't say what they
  39. were for!  One had just to write a task-switcher, creater, etc,
  40. and patch KEY, EMIT & ?TERMINAL to get the old round-robin
  41. multi-tasking!  If you write things correctly, multi-user
  42. was no problem).
  43.  
  44. Yeah, that file system took nearly 20k of my home-brew 6800 (no, 
  45. I didn't forget a '0') system's 64k, but it was never regretted.
  46.  
  47. I can't express to those who have never made that transition how
  48. much easier software development was!  We never dealt with
  49. SCREEN numbers again!.  We had filenames!
  50.  
  51. Now we had commands like LOAD-FILE, EDIT-FILE, CREATE-FILE,
  52. DELETE-FILE, RENAME-FILE, COPY-FILE (even between different
  53. volumes!), COMPARE-FILES, GET-FILE-INFO, great stuff!
  54.  
  55. On a hard-disk, we could CREATE-DIRECTORY at several places,
  56. in effect yielding different partitions, each with it's
  57. own copy of this architecture.
  58.  
  59. None of this was real complicated, a simple bit-mask block-list (I
  60. think at SCR#10) where we could allocate BLOCKS on the disk from and track
  61. them.  Another area to store the filenames and a few pointers to
  62. things like that file's individual block-list, and whether it was
  63. level 1 or level 2 (using 4 bytes for a pointer, the block-list
  64. could point to the possible 256 screens in the file.  If a file
  65. wanted to larger, the file system would automatically change it to
  66. 'level 2'...a 'master' block-list would point to upto 256 block-lists,
  67. each of which could be used to trach 256 BLOCKS of the file.
  68. This gave us a maximum file size of 256x256 BLOCKS or
  69. 65 Meg.  This seemed infinite at the time because our largest
  70. hard drive was 5 Meg!).
  71.  
  72. We later used this 'filename' area to save the files creation &
  73. modification dates, so true incremental backups could be automatically
  74. made by datestamp comparison.
  75.  
  76. And all our code was ported almost instantly!  We had to change
  77. 3 things in any program...
  78.  
  79.    1. Open the file at the beginning
  80.  
  81.    2. Replace ever instance of BLOCK with FILE-BLOCK
  82.  
  83.    3. Close the file when done
  84.  
  85. (FILE-BLOCK did all the work... it would make sure the
  86. file was big enough, do the logical-file-block# to
  87. physical-screen# conversion, call BLOCK, then return thre
  88. buffer adr)
  89.  
  90. This opened a world of ease, convienience, organization,
  91. it was incredible how much faster we could develop code.
  92.  
  93. And this was with just a BLOCK-based file system... the code was still
  94. in SCREENS... it's just that now we could consider SCREENS
  95. 45, 80 and 19 to be contiguous...the file system made it so virtually.
  96.  
  97. It was a simple matter to implement INSERT-FILE-BLOCK, so
  98. forget LOAD-SCREENS!   All of your code was now
  99. maintained in order for you, compiled in order, IT WAS A
  100. SINGLE OBJECT!
  101.  
  102. Now we could keep little support routines like SQRT in something
  103. called SQRT (instead of knowing it's on SCREEN 267), and when
  104. needed it could be compiled quickly with a simple...
  105.  
  106.    LOAD-FILE SQRT
  107.  
  108. And it was no sweat to dump the files logical file-blocks
  109. (non-contiguous screens) to a virgin disk in contigous
  110. fashion, so that anytime, you could revert to the normal
  111. BLOCK environment again. (but we never did)
  112.  
  113. Anyway, this early experience really sank in, and I've
  114. never used SCREENs in their normal mode again.  I ported
  115. that file system to other Forths... even platform Forths
  116. (the other guy was a CP/M man) and that led to the curious
  117. situation of having files (ours) within screens (the forth's)
  118. within files (C/PM's)!!!
  119.  
  120.  
  121. Now the ol' 6800 system gathers dust in a closet, hasn't been
  122. turned on in years.  With JForth and my Amiga, I deal
  123. with real end-of-line terminated files in the powerful
  124. Amiga OS...they are no different than C or Pascal source files
  125. in that I can use any OS utility on them (like diff, type,
  126. copy...anything).  I don't even think a 2cnd thought about it anymore,
  127. except when I, just for grins, INCLUDE the BLOCK environment which
  128. includes the full-screen editor and play around with SCREENS
  129. inside of an Amiga file.  Man, it's wierd to be using screens!
  130.  
  131. Don't get me wrong... I wrote SCRED (the full-screen editor) and
  132. I'm damn proud of it... any Forth programmer would enjoy
  133. using it... but I never do.  But it's OK, because I also wrote
  134. the editor I use on my JForth files.  And it's a standard
  135. text editor that I sell as shareware and very fancy.  Y'see...
  136. there's a REAL MARKET for STANDARD STUFF!  That makes you want to
  137. make it real fancy... because you have a REAL MARKET...
  138.  
  139. Oh well, I'm starting to prostilatize (sp??) again.  (I can hear
  140. the shouts... WHEN DID YOU QUIT?).
  141.  
  142. Ah, nostalgia is good for the soul.
  143.