Hacker News new | ask | show | jobs
by vidarh 5038 days ago
I love Ruby. It is my favourite language by far. And I strongly believe that it is possible to do a Ruby implementation that is fast enough for most uses.

But current implementations are slow. And there are a lot of things in the language that makes a fast implementation hard. For example the fact that class definitions are executable and can be re-opened at any time, including by passing a string to eval(). They combine to make it extremely hard to make method calls fast. And since pretty much everything is method calls in Ruby, that's not good.

As an example, a Ruby implementation has to be able to deal with code that might overload the + method for integers, so even basic stuff like integer additions can't be statically inlined without precautions to handle cases like that.

I'd say for what they're doing, with tiny little rewrites in Nginx, Lua might be better suited - the Lua implementation is known for being extremely fast.