Skip to content
a ruby-to-pyc compiler
Branch: master
Clone or download
Pull request Compare This branch is even with devyn:master.
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin * lib/unholy/pyasm.rb: got some basic blocks working. slight work on… May 15, 2008
decompyle * decompyle/: remove verbose debugging output, for now. May 5, 2008
python * python/ use `eval` in order to get the block's return val. May 15, 2008
tests * lib/unholy/pyasm.rb: jump opcode and empty arrays. May 15, 2008
COPYING * COPYING: an mit license. May 5, 2008
README * lib/unholy/pyasm.rb: re-merge the line numbers fix. May 6, 2008


          $ UNHOLY $

  Compile Ruby to Python bytecode.
  And, in addition, translate that
  bytecode back to Python source
  code using Decompyle (included.)

  Requires Ruby 1.9 and Python 2.5.

         $ INSTALL $

  First, install decompyle:

  > cd decompyle
  > python build
  # python install

  Then, in the main directory, use
  the tools.


  To compile Ruby to a .pyc:

  > bin/unholy test.rb
  > PYTHONPATH=python \
               python test.rb.pyc

  To translate to Python:

  > decompyle test.rb.pyc >


  And, to view the disassembled
  > bin/py-dis test.rb.pyc

  Thanks to Ned Batchelder for his
  rather juicy posts on dissecting
  Python bytecode.  It is only too
  bad that a Rubyist got a hold of
  them. :(

        $ POTION $

  Now, image if Ruby and Python
  were to combine into something
  new.  Let's call it "potion":

  > potion
  > potion test.rb

  You know, it's crazy that Python
  and Ruby fans find themselves
  battling so much.  While syntax
  is different, this exercise
  proves how close they are to
  each other!  And, yes, I like
  Ruby's syntax and can think much
  better in it, but it would be
  nice to share libs with Python
  folk and not have to wait forever
  for a mythical VM that runs all
  possible languages.

You can’t perform that action at this time.