home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.forth
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!sol.ctr.columbia.edu!venezia!penev
- From: penev@venezia (Penio Penev)
- Subject: Recent FORTHs' guts (was: Documenting)
- References: <1993Jan22.232144.8420@murdoch.acc.Virginia.EDU>
- Sender: nobody@ctr.columbia.edu
- Organization: Rockefeller University
- Date: Sat, 23 Jan 1993 12:27:39 GMT
- X-Newsreader: TIN [version 1.1 PL6]
- Message-ID: <1993Jan23.122739.24899@sol.ctr.columbia.edu>
- Reply-To: penev@venezia.rockefeller.edu
- X-Posted-From: venezia.rockefeller.edu
- NNTP-Posting-Host: sol.ctr.columbia.edu
- Lines: 50
-
- Julian V. Noble (jvn@fermi.clas.Virginia.EDU) wrote:
- : Review of HS/Forth
- :
- : I have used HS/Forth since version 1.x, which I acquired sometime
- : in 1984. It has grown to be a very complete system with all sorts of
- : utilities, libraries, etc. included. A late version (that I have not
- : yet tried) includes a DOS extender and can therefore address a 32-bit
- : flat memory space with reasonable speed (i.e. not swapping it in and out
- : of 64K buffers below in the top of the first 1 Meg).
- :
- : Although I have not personally done any of this, Callahan provides
- : interfaces to C and other compiled programs. This lets you use
- : commercial C libraries, e.g., for graphics, etc.
- :
- : Finally, most of the kernel (code primitives) is very slick and semi-
- : optimized. Ex: the BX register is used as TOS, hence @ is just
- : CODE @ BX [BX] MOV. END-CODE
- : Note also that Callahan does the obvious, incorporating NEXT in
- : END-CODE. I was a bit surprised to see fairly recent Forths that do
- : not do this.
-
- I think, that when one designes a FORTH for a machine with a lot of
- memory, native code is the better way. It's faster, while not wasting
- much. On a i386 one have 4-byte 'address' and a 5 byte 'call address'.
- Well, it's not like having 15 bit 'address' and 16 bit 'call address'
- like in RTX, but it's still tolerable.
-
- Another consideration is when You run RISC processors (I'm running
- R3000 currently). There You have even more space and You can benefit
- _a lot_ from the inlining of some primitives. The call on this
- processor cannot be made less that 2 instructions (read 2 clocks and 8
- bytes). But the You have something like this for the @ , TS being top
- of stack :
-
- : @ TS ) TS lw ; IMMEDIATE
- : @ @ ;
-
- I even developed a 8051 FORTH, (polyFORTH - like) that used native
- calls and inlining. It performed about the speed of some old 8088
- FORTHs. The good thing there is that one has near (2K) calls, which
- compile to 2 bytes instaed of 3. With well structured applications the
- tendency is to make near calls. There one can use phrases like
-
- : AWORD FORTH WORDS [ assembly operators ] OTHER FORTH WORDS ;
-
- Great for controlling devices. _Fast_.
-
- Flames welcome.
-
- -- Penio.
-