On Wednesday, October 9, 2002, at 09:03  AM, Brian Ingerson wrote:

> So the first time dubble is called, it compiles/loads a single function
> shared object call main_dubble.so. The cool part is that the symbol 
> table is
> then hacked to point to the C version instead of the Perl wrapper. 
> That's
> about it. They do the whole thing in a very small amount of code.
>
> The obvious drawbacks are:
>   - No typemapping
>   - Must work the stack yourself
>   - Happens at runtime

I'm thinking about a way to do it at compile time, but I'm not sure how 
it would go yet... probably something like:

        require 'inline'
        class Blah
          import Inline
          compile_time_inline :methodname, <<-END
            ....code....
          END
        end

but there are some minor things I need to flush out.

I'm curious, why is this considered a drawback by you and/or the perl 
inline community? I must ask, what is the benefit here that you guys 
see over runtime compilation. On my machine (750Mhz P3 running 
freebsd), it takes an average of .07 seconds to export, compare, and 
compile over a normal load and run.

>   - Lots of little single function objects

Again, why a drawback? On the ruby side, the load doesn't seem to cost 
anything (that I can measure).

>   - Probably for scripts only

Why? How is the use case different for modules/classes vs scripts?

P.S. Please respond to both lists, I'm not on inline@.

Reply via email to