OT: Perl parser

Since it came up earlier and was the subject of some discussion, I
figured I’d add to the confusion^Wcommon body of knowledge regarding
Perl’s compiler/interpreter status:

Perl does not compile to bytecode and does not use a VM, as implied in
some previous comparisons to Java. The JVM is, in some respects,
essentially an extremely limited form of operating system emulator,
where the OS is specifically designed for the sole purpose of running
Java bytecode-compiled programs. Java source is compiled to bytecode
form (JVM-native code) and stored in that form. Then, when you want to
execute the program, you turn on your virtual computer running your
virtual Java OS and run your program there.

Perl, meanwhile, compiles to parse trees, which are then interpreted in
a mostly-traditional programming language interpreter model of
execution, with no VM processes running. This may not immediately
strike one as being particularly different, but it should be noted that
classic interpretation is a line-by-line execution of instructions
(which are in this case harvested from a parse tree) within an operating
environment, while a VM is itself an operating environment that happens
to require an enclosing operating environment. Each approach has its
own positive and negative performance characteristics.

Now that I consider the matter a bit more, I’m amused to consider that
the compilation phase for Perl results in something strangely akin to
compilation-to-Lisp (Lisp being, in some respects, nothing but
human-readable parse trees).

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs