3 ms·
> _why's unholy showed it's trivial to compile Ruby into Python (in many cases). It shouldn't be too hard (famous last words) to make a Ruby VM with PyPy. Basi
by judofyr 15y ago
> _why's unholy showed it's trivial to compile Ruby into Python (in many cases). It shouldn't be too hard (famous last words) to make a Ruby VM with PyPy.
Basic structures like if, else, while etc. is easy. The hard part is the object model (including constant lookup) and long jumps (exceptions, next/break). Let's not forget the big core library which you need to implement if you want it to be usable at all…
(Related: I started working on a Ruby version in JavaScript: https://github.com/judofyr/rubyscript https://github.com/judofyr/rubyscript)
- mdaniel 15y ago> Let's not forget the big core library which you need to implement if you want it to be usable at all Wouldn't one just point the translator/compiler to whatever Ruby's equivalent is of /usr/lib/python2.7 and let it be "turtles all the way down"?
- judofyr 15y agoCore != Stdlib. Core is implemented in C. There are 111 methods just on the String class in core…