GARTHWILSON wrote:
Are you talking about a metacompiled system where you can also compile headerless code since FIND will never be needed to look up words? That saves a very significant amount of memory, not just because you don't have INTERPRETER, FIND, COMPILER, COMPILE, <comma>, ALLOT, <colon>, ], etc., but more than that, all the memory taken by headers. You can deliver applications where the user has no need to interpret or compile, and in fact doesn't even need to know that the application was written in Forth.
I won't need a metacompiler. I can still make a headerless Forth with the use of FIND and INTERPRET. In another thread I mentioned using an insertion sort to sort words. The words are passed to the insertion sort with a beginning length byte and the CFA pointer after the word. The insertion sort not only inserts words into the sorted dictionary, but can also find any word and return the CFA after the word. The CFA obviously pointing to the actual code in the Forth system.
Because the words are sorted alphabetically, they can then be searched using a binary search method, which means they don't require the Link Field (LFA). It becomes even more handy for me that I can move the Interpreter to anywhere in memory, because the insertion sort can be part of the interpreter. I have not decided where to move it yet, because once the Interpreter is compiled at a certain location, it will have to stay there. I may end up with the Interpreter compiled at a couple of different locations, depending on how memory restrictions pop up.
Anyone wondering how I plan on compiling the interpreter without the Interpreter as part of the Forth system?