Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!zephyr.ens.tek.com!uw-beaver!ubc-cs!alberta!ncc!idacom!andrew From: andrew@idacom.uucp (Andrew Scott) Newsgroups: comp.lang.forth Subject: Re: Vectored Execution Message-ID: <1990Aug28.160157.3938@idacom.uucp> Date: 28 Aug 90 16:01:57 GMT References: <12398@sdcc6.ucsd.edu> Organization: IDACOM, a division of Hewlett-Packard Lines: 35 John Wavrik writes: > There is a good reason for wanting words (like > DEFER and IS) for vectored execution to be part of the language > standard rather than user defined. Here are some timings for 100,000 > executions of a NOOP -- both directly and using various approaches to > vectored execution: [ timing figures deleted ] > In F83 the mechanism for vectored execution is coded in assembly > language -- and the overhead for executing a word indirectly is > surprisingly small. I don't think execution speed of a word in a certain implementation is a compelling reason to include it in the standard. I think that optimization is a job best left for the compiler and not the language designer. For the same reason, I think words like 1+ and 1- should at least be moved from CORE to EXT CORE. They unnecessarily clutter the language. I realize they have existed for many years and are noticably faster in *some* Forth implementations. I think it's a wart to make addition or subtraction by 1 a special case. It's another wrinkle a newcomer to Forth has to learn. Anyway, the EXT CORE word PERFORM is useful for vectored execution: VARIABLE ACTION ( our execution vector ) ' SOMETHING ACTION ! ( assign something to the vector ) ACTION PERFORM ( execute the vector ) I prefer this to the DEFER and IS solution because of the prefix-postfix reasons we've been discussing for a while. -- Andrew Scott | mail: andrew@idacom.uucp | - or - .!uunet!ubc-cs!alberta!idacom!andrew