Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Your contraction massively misrepresents what I wrote. Compiling Ruby is by no means easy. And optimizing it to similar speed as e.g. C is massively hard.

But optimizing the dynamic dispatch down to the cost of a vtable call is trivially easy.



"Your contraction massively misrepresents what I wrote."

Yeah, sort of, but it represents what I was trying to say accurately enough. You will find, as you go through your project, that nothing is "trivially easy" when it comes to JIT'ing Ruby, and, alas, "just compile it down to a vtable call" is likely to not be that easy either. Dynamic language JITs have a terrible recursive 90/10 problem. In fact I doubt that it actually will be that simple because if it were, PyPy would be a great deal faster than it is.

(From a JIT perspective, Ruby and Python are all but identical.)

The point I'm making is not that you shouldn't do this. The point is that A LOT of people have ALREADY done this, and it has proved to be a lot harder than any of them thought, and you really ought to take some time to go study PyPy or various PHP JIT projects before getting too excited about thinking that you are going to speed Ruby up as much as you think you are. Particularly have a look at RPython. If you are going to tackle this project, this notorious Zeno tarpit [1], I recommend everyone do it with eyes open. No, it isn't going to be as easy as "just do X", or it would already have been done.

[1]: http://esr.ibiblio.org/?p=6772


> nothing is "trivially easy" when it comes to JIT'ing Ruby

First of all, I'm not JIT'ing Ruby. Secondly, a lot of things are "trivially easy" when it comes to compiling Ruby - even ahead of time. I know, because while there's lots of outstanding bits, I am compiling a reasonable subset, and I understand the remaining tradeoffs well enough to know where the pitfalls are - it's by no means my first compiler

> The point is that A LOT of people have ALREADY done this

A lot of people have done this, but despite decades of history of optimisation of dynamic languages, most of them appears to not have bothered with even a cursory look at the literature.

In terms of JIT, the Truffle backend for JRuby is a good example of the difference actually applying modern techniques makes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: