Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!sdcc6!ir230 From: ir230@sdcc6.ucsd.edu (john wavrik) Newsgroups: comp.lang.forth Subject: Vectored Execution Keywords: ANSI Message-ID: <12398@sdcc6.ucsd.edu> Date: 24 Aug 90 17:37:09 GMT Organization: University of California, San Diego Lines: 64 Re vectored execution, I asked: >> II. Deferred Execution >> Will the proposed ANSI standard have a portable mechanism for >> deferred execution (like the F83 words DEFER and IS) Mitch Bradley replied: > : DEFER CREATE 0 , DOES> @ EXECUTE ; > : SET-DEFER ( cfa cfa -- ) >BODY ! ; I assume that this means that the ANSI Standard does not provide a mechanism for vectored execution and that Mitch is showing how one can be defined. (Such a mechanism was not in the last BASIS document I have and has apparently not been provided since.) Mitch's approach is essentially a dressing up of the fig-Forth approach: store the cfa of a word in a variable, and later execute the contents of the variable. ---- Vectored execution is one of the areas mentioned in the TC document posted by Jack Brown. 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: BARE NOOP 2.25 seconds FIG APPROACH 3.79 seconds BRADLEY APPROACH 4.89 seconds F83 APPROACH 2.69 seconds In F83 the mechanism for vectored execution is coded in assembly language -- and the overhead for executing a word indirectly is surprisingly small. ---- I asked whether a simple non-exotic Forth application written to answer a question of Wil Baden could be written in the proposed ANSI Standard. Specifically: 1. Can the return stack be extended to make recursion viable? 2. Is there a Standard mechanism for deferred execution? 3. Can the user control compilation enough to define a simple control-flow structure? I would like to thank for Mitch Bradley for replying. As he has shown, the answer is a discouraging NO on all points. Now that the ANSI Team perceives itself to be near completion, it would be a good time to test the proposed Standard to find out whether or not it is missing essential ingredients. I don't share the view of those who think that an ANSI Standard is "window dressing" and is not supposed to support real programming. John J Wavrik jjwavrik@ucsd.edu Dept of Math C-012 Univ of Calif - San Diego La Jolla, CA 92093