>>>>> "SC" == Simon Cozens <[EMAIL PROTECTED]> writes:
SC> On Mon, Oct 23, 2000 at 08:33:23PM -0400, Uri Guttman wrote:
>> so the TIL generated code would still to parameter setup, then an
>> indirect function call and then result handling. it should still be
>> faster than an interpreter and simpler to generate than fully compiled
>> code.
SC> Is this actually, in any sense of the word, true?
yes it is true. i have worked on compilers and debugged both the
generated inline code and runtime calls code. a full compiler generates
mountains of code to do basic operations in any combination. and
optimizing machine code is very architecture specific. debugging the
runtime call code was much simpler. the machine level api was defined
and you just had to get that right and pass in arguments cleanly. the
inline code generation took much more work to write and to debug.
i would not tackle a true code generation project. i would have no
qualms about working on a TIL code generation project. they are worlds
apart in complexity.
TIL code is almost template driven. here is the code to setup a scalar
arg, to set up a hash arg, here is the op code function call template,
etc. you just fill in the constants and offsets in the proper slots in
the code and you're done. you can't even code + inline, just the call to
the plus op code function.
SC> I don't see anything that distinguishes this from the ordinary process of
SC> generating code with a runtime library and a stack.
as dan has said, you move the code out of data space and caching. it
will generally run faster than pure interpreting and have a simpler code
generator.
it has the kind of tradeoffs i like. you get more bang for less coding
effort. a true compiler is much harder to create.
and remember it is not critical path but it should be addressed in the
architecture of the backend subsystem. with dan liking it, i doubt that
it will be forgotten. if he does forget it, i will poke him with a soft
cushion a lot.
uri
--
Uri Guttman --------- [EMAIL PROTECTED] ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com