Some more Ruby observations (Re: Comparison between Python and "Ruby")

William Tanksley wtanksle at hawking.armored.net
Thu Nov 4 22:01:58 CET 1999


On 5 Nov 1999 01:22:23 GMT, Neel Krishnaswami wrote:
>Greg Ewing <greg.ewing at compaq.com> wrote:
>>Here are some random observations from studying the Ruby
>>source code:

>>* It doesn't use bytecode. The evaluator seems to operate
>>  directly on a parse tree. I don't know what implications
>>  this has for execution speed.

>I was under the impression that Ruby did tail-recursion elimination,
>and since continuation-passing forms are just a hair away from
>bytecode, I am a bit surprised by this news. I'm not saying this is
>impossible (witness the scm Scheme interpreter), mind, just a little
>surprised.

>Are there any syntax-tree munging phases to do stuff like common
>subexpression elimination and loop hoisting? I guess that could yield
>enough speedups to make a VM not yet necessary.

Parse trees tend to evaluate faster than bytecode when both have only
primitive optimizations.  They are also much, much easier to optimize.  In
general, I would expect a parse tree implementation to outperform a
bytecode implementation given equivalent work.

>Neel

-- 
-William "Billy" Tanksley




More information about the Python-list mailing list