Is Perl a compiled or an interpreted programming language?

前端 未结 9 2038
谎友^
谎友^ 2020-12-24 03:36

Is Perl compiled or interpreted?

9条回答
  •  不知归路
    2020-12-24 04:03

    Both. First, Perl 6 script is compiled to bytecode (and optimized). Then it is executed (however, you still need Perl interpreter for this). Bytecode is kind of executable code, which is independent from environment it runs on (the same bytecode can run on Unix enviroment on ARM processor, Windows system with x86 and Haiku on x64).

    Perl 6 can be compiled to Parrot VM (Virtual Machine) bytecode. Parrot VM is used by Python and Ruby as well.

    This is what makes Perl, Ruby and Python faster than PHP, which is just interpreted (can be compiled as well, but you need 3rd party components for this).

提交回复
热议问题