in reply to Re: How is a perl program processed ?
in thread How is a perl program processed ?

There is no bytecode.

  • Comment on Re: Re: How is a perl program processed ?

Replies are listed 'Best First'.
Re^3: How is a perl program processed ? (two kinds)
by tye (Sage) on Apr 01, 2003 at 22:12 UTC

    Note that a Perl regex is compiled into a tree of regnodes while the rest of the Perl code is compiled into a tree of opcodes.

    So there are two different kinds of non-"byte-code"s here. The original inspiration of this thread was talking about regnodes while you've linked to a discussion about Perl opcodes.

    The regnodes and opcodes are quite similar, so the impressions people have gotten from this minor misdirection are likely rather accurate. (:

    I've heard that Perl is relatively slow at dispatching opcodes and relatively fast at dispatching regnodes such that formulating problems as a regex can be quite a bit faster than formulating them as Perl code. Not that this is usually an easy proposition.

                    - tye

      Great to see the topics diverting back to regex...i've been love with the beauty of regexes in perl. Wonder if there is any other language that has this capability of handling regex ?

      So why shud perl slow down while processing tree of opcodes if processing a tree of regnodes CAN be done faster ?

      If there is some optimized way of processing one kinda tree, cudnt it be applied to all nodetrees and make everything one step faster ?

      That cud make working with perl even more delightful!! I'm sure the monks cud throw some light in this angle i'm thinkin..

Re: Re: Re: How is a perl program processed ?
by TheYoungMonk (Sexton) on Apr 01, 2003 at 11:31 UTC

    That was really enlightening !!

    Thanks for all the info on perl being interpreted or compiled, but this last link proved to be the "missing link" in our discussions...i was actually searching for places to see how we can so freely use the term "bytecode" as in languages like java...this link provided the answer

    Got a good insight...and hope the discussion will be useful for other seekers!