Perl 5 model
- The code we were looking at is in the parser itself
- We could have done eval $some_perl_code, but that's slow
- We could have used the internal API, but that's hard
- Instead, express what you want to do in the same way the parser does it
- Use ASTs
- Whatever those are
This is probably the source of the confusion about calling Perl an interpreter: there's no storage for the result of the a parse that is kept outside of the evaluator (unless you're doing very fancy stuff). Unlike the strict definition of an interpreter, though, Perl does compile as much as it can straight off when it can. ...cgi -> fastcgi -> mod_perl ...parser always available to support eval ...btw did you know that the javac compiler is also available via a programmatic interface? And that you can load new classes at runtime? also available via a programmatic interface? And that you can load new classes at runtime?