Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!enmasse!rclex!harvard!uwvax!astroatc!philm From: philm@astroatc.UUCP (Phil Mason) Newsgroups: net.lang,net.lang.forth Subject: Re: RRe: What's so good about FORTH? Message-ID: <433@astroatc.UUCP> Date: Mon, 16-Jun-86 09:46:10 EDT Article-I.D.: astroatc.433 Posted: Mon Jun 16 09:46:10 1986 Date-Received: Wed, 18-Jun-86 02:53:28 EDT References: <201@pyuxv.UUCP> <3700003@uiucdcsp> <132@vaxb.calgary.UUCP> Reply-To: philm@astroatc.UUCP (Phil Mason) Organization: Astronautics ATC, Madison, WI Lines: 39 Keywords: FORTH, threaded-code Xref: watmath net.lang:2485 net.lang.forth:424 In article <634@ucbcad.BERKELEY.EDU> keppel@pavepaws.UUCP (David Keppel) writes: >In article <432@astroatc.UUCP> philm@astroatc.UUCP (Phil Mason) writes: >>* small size : theaded-code is about a small as you can get. > >Pardon, but I've never quite understood what threaded-code is. >Could somebody give me an explanation of > o what it is > o why it is fast > o why other major languages don't use it or don't admit to using it > Threaded code is a interesting concept. If you have an algorithm, and express the algorithm with nothing but subroutine calls, one could say that the code is threaded. In FORTH, the subroutine calls are implicit. In a high-level (non-assembly language) routine, a list of the addresses of all of the component operations, in the proper order, is sufficient to describe the operation of the routine. Threaded code is not by its nature fast. It is amazingly compact, however. Speed is determined by the qualities of the threaded code interpreter and the processor on which the interpreter runs. If subroutine calls are very expensive time-wise on the processor, threaded code will REALLY gum up the works. FORTH appears to be the only major language that uses threaded code as the primary means of expressing algorithms internally. Other languages and applications do use threaded code but by no means even close to the extent that FORTH does. Threaded code is used for compactness and simplicity. - - -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Kirk : Bones ? | Phil Mason, Astronautics Technical Center Bones : He's dead Jim. | Madison, Wisconsin - "Eat Cheese or Die!" - - - - - - - - - - - - - - - -| ...seismo-uwvax-astroatc!philm | I would really like to believe that my ...ihnp4-nicmad/ | employer shares all my opinions, but . . . =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=