Path: utzoo!attcan!uunet!willett!ForthNet From: ForthNet@willett.UUCP (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: Linking, Modules, and Overlays Message-ID: <490.UUL1.3#5129@willett.UUCP> Date: 18 Feb 90 01:53:21 GMT Organization: Latest link in the ForthNet chain. (Pgh, PA) Lines: 41 Date: 02-16-90 (09:27) Number: 2915 (Echo) To: DAVID ALBERT Refer#: NONE From: JACK WOEHR Read: NO Subj: FORTH MODULARITY Status: PUBLIC MESSAGE > I do however have several questions: First, I have seen that several >implementations of Forth use a small "inner interpreter loop" using >DS:SI for example as the instructioni pointer. I chose just to use CAL >and RET as the entry and exit to my words. Therfore, CS:IP is my >instruction pointer and word pointer. Here's the question: Why do >people use the separate inner interpreter loop? It seems that the call >and return are much more flexible and that I can more easily manipulate >return addresses since they are just on the stack. I use BP for my >parameter stack pointer. What you observe is quite valid ... on the 80x8x family, three types of threading are common: indirect, direct and subroutine threading. With proper compiler optimization tricks, the latter (your choice) should execute fastest but use more memory than the other two schemes. All these threading schemes have variations, too ... > Question number 2: Since I have come from a Modula-2 background, >reusable, compiled libraries are very important (to me anyway) in the >course of developing good applications. Due to the interpretive nature >of TILs, I seem to be having some trouble implementing libraries. I >would like to allow several libraries (vocabularies) which can be >manipulated independently and linked into my final application. I have >read some of the solutions on late binding, but none I've seen have bee >satisfactory. Does anyone have any ideas, hints, etc. Do you know how >anyone else does it? Any advice would be appreciated. JForth on the Amiga features linkable modules ... you should perhaps examine their handling of this trickly matter. =jax= NET/Mail : RCFB Golden, CO (303) 278-0364 VESTA & Denver FIG for Forth! ----- This message came from GEnie via willett through a semi-automated process. Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'