Page 2 of 2

Re: Series of articles about internals of various Forths

Posted: Fri Mar 07, 2014 7:57 pm
by GARTHWILSON
Quote:
Somehow I got wrapped around the idea that for it to be a Forth, it had to be Forth-83 compliant, or even ans-compliant. And that meant having BLOCK work just like in Leo Brodie's "Starting Forth" book
Keep in mind that there are embedded Forth applications running from ROM, with no mass storage of any kind, and even compiled with headerless code so they can't look anything up in a dictionary, and in that case you can also remove FIND : , C, CREATE ALLOT and so on.

My workbench computer has very little human I/O, and, although it can read and write serial EEPROMs and large serial flash memories, it really has no file system built in. All program material I load into it comes to it as source code over an RS-232 line from the PC (or other host), and it compiles, assembles, or interprets, as appropriate, on the fly, as the source code is coming in. The PC just thinks it's printing the material to an old serial printer with no graphics capability. The workbench computer has Forth-83 in EPROM (with additions I have chosen from many sources) but it doesn't know what a block is. I formed the Forth on the PC and programmed it into the EPROM, including the Forth assembler.

Re: Series of articles about internals of various Forths

Posted: Fri Mar 07, 2014 9:00 pm
by nyef
Brad R wrote:
Are you aware that BLOCK is an optional word in ANS Forth? Blocks vs. files is one of the oldest debates in Forthdom; the ANS committee compromised by specifying the behavior of both, but requiring neither to be present.
I was looking through this part of the spec not so long ago while I was trying to figure out how best to update my own Forth system, and I noticed that while the committe specified that you must implement the BLOCK wordset if you want to implement the File-Access wordset, there's apparently no requirement to define valid blocks, which leads to a fairly trivial, standard-conforming, and completely useless implementation.

Still, if you want ANS compliance, support for files, and couldn't be bothered about blocks, it's an option.

Re: Series of articles about internals of various Forths

Posted: Fri Mar 07, 2014 10:45 pm
by Brad R
I had forgotten about that requirement. But somewhere in the fine print there's also the detail that you can make any "required" word set user-loadable. Which means it's sufficient to provide the source code for BLOCK. (This gave an "out" to those who wanted to make a files-only Forth.)