<i>This power does not come without a price. Ruby is slow. Ruby is generally recognized as being twice as slow as Python, and at least an order of magnitude slower than C++ or Java.</i><p>The last two statements don't mean the first is true. Ruby's power is <i>not</i> the reason it's slow. Smalltalk VMs are proof by existence that the Ruby model can be fast. (See: Self, Strongtalk, Gemstone.) MagLev showed that Ruby is basically just an alternative Smalltalk syntax.<p><i>Charles Nutter, one of the creators of the JRuby VM for the Ruby language, recently posted an article about optimizations that could be made to the VM, and he improves Ruby performance by as much as twenty times by removing much of Ruby’s power and breaking compatibility.</i><p>"Remove much of Ruby's power"? Around 0.2% of Charles's speed-up came from removing the ability to override the primitive math operations. Other than that, his speedups removed <i>none</i> of Ruby's power.<p>(And nit-picking: <i>Ruby is probably the most powerful programming language on the planet for creating DSLs, or domain specific languages. It can do this because any class or object can be extended, any method overridden, any constant undefined and redefined, and so on, and so forth.</i><p>Not true:<p><pre><code> >> class StrangeArray < Array; def [](x); x; end; end
nil
a = StrangeArray.new(10)
=> [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]
>> a.map{|x| x}
=> [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil] # wrong
>> (0..(a.size - 1)).map{|x| a[x]}
=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] # right</code></pre>
I.e., the built-in implementation of Array#map statically refers to the built-in implementation of Array#[].)<p>(Edited to correct example, as pointed out by hjdivad)