Forth like interpreter
Samuel A. Falvo II
kc5tja at garnet.armored.net
Mon Mar 13 17:38:26 EST 2000
In article <HQez4.485$Lh9.192581632 at newsb.telia.net>, Fredrik Lundh wrote:
>umm. do you seriously think that the best way to
>speed things up is to go find something that takes
>less than one percent of the execution time, and
>work very hard on making that little part run a few
>percent faster?
No offense, but the above quote leads me to firmly believe you have little,
if any, experience in writing a Forth environment. In Forth, the sheer bulk
of the environment is written in words, such as:
: Hello ." World" CR ;
Most Forth words are about a line in length each, and almost unanimously
reference other words written in a similar manner. Almost everything is a
word: normal subroutines, variables, constants, vocabularies, and more. As
such, the inner interpretter (as it's called) gets executed far more often
than you realize.
It DOES make a difference, by sheer virtue of the fact that most Forth words
are quite small in size.
>very close to zero, on most modern platforms.
Do you have any references to documentation to back this up? Darrel posted
the URL to a piece which seems quite clearly to indicate otherwise. Also
consider that this is entirely compiler specific as well, and depends
entirely on whether or not the collection of cases in a switch statement
form a contiguous space or not. Not all compilers implement switch
statements as jump-tables.
--
KC5TJA/6, DM13, QRP-L #1447
Samuel A. Falvo II
Oceanside, CA
More information about the Python-list
mailing list