# OT: Perl parser

**URL:** <https://www.ruby-forum.com/t/ot-perl-parser/100392>\
**Category:** Ruby\
**Created:** [July 28, 2006, 6:46pm UTC](https://www.ruby-forum.com/t/ot-perl-parser/100392 "2006-07-28T18:46:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpeterson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58f4c7/32.png) [@cpeterson](https://www.ruby-forum.com/u/cpeterson)\
**Post date:** [July 28, 2006, 6:46pm UTC](https://www.ruby-forum.com/t/ot-perl-parser/100392/1 "2006-07-28T18:46:36Z")

</div>

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).
