in reply to Runtime introspection: What good is it?

Premise: There's nothing that can be done with run-time introspection that cannot be done (better) by compile-time decision taking.

I believe that JIT is a counter-argument to your premise. It's not strictly relevant to the kind of code you're interested in, but the kind of optimizations JIT does (which are a great performance boon) simply cannot be done compile-time.

  • Comment on Re: Runtime introspection: What good is it?

Replies are listed 'Best First'.
Re^2: Runtime introspection: What good is it?
by chromatic (Archbishop) on Jul 07, 2008 at 05:59 UTC

    Sure they can -- just not as well.

    Okay, you can't use the polymorphic inline cache strategy at compile-time, but you can predict which variant will get called the most and emit instructions to redispatch if necessary. (I don't know of any JITs which recompile the dispatch when the call characteristics change, but I can imagine that it's possible. Factor may; I think I read something about that.)