by avyjit · 4y ago · 0 comments
Other languages could do the same, but often they have a few more layers before they start running that C code.
I'd be curious to know if the perl grammar also somehow lends itself to being fairly optimizable for it's interpreter.
But Python, Ruby etc all compile to bytecode, and have always done so as far as I can remember.
IDK. I didn't waste time checking why.
My guess is that due to the much smaller code size, it reaches a sweetpoint where it fits nicely in the L1 or L2 cache.
But it's just a hunch, I couldn't prove it.
while(<STDIN>) {
print $_;
}
isn't doing much of its work at the top level.