Hacker News new | ask | show | jobs
by jandrese 1378 days ago
Perl does a kind of half JIT when you start a script. It doesn't compile fully down to native machine code, but it does parse and lex the script to build an internal representation. The code is then interpreted, but since it doesn't have to parse each line again it runs very fast and also you can interpret code on the fly in a variable so you get the best of both worlds.
1 comments

This has been the usual way to implement interpreted languages for decades; Perl isn't special in that regard. JIT generally refers to generation and execution of native code specifically.
I'm pretty sure bash still interprets line by line because you can mess up a script by editing it while it is executing.
bash (and other shells) are special in that regard, because they use textual substitution so heavily - to pass arguments etc.

But Python, Ruby etc all compile to bytecode, and have always done so as far as I can remember.