4 ms·
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 in
by jandrese 4y 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.
- int_19h 4y agoThis 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.
- jandrese 4y agoI'm pretty sure bash still interprets line by line because you can mess up a script by editing it while it is executing.
- int_19h 4y agobash (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.