a ruby-to-pyc compiler - _why mirror
License
devyn/unholy
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
$ 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 setup.py build # python setup.py 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 > test.py --- And, to view the disassembled bytes: > 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 test.py HELLO FROM PYTHON > potion test.rb KONNICHIWA FROM RUBY 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.
About
a ruby-to-pyc compiler - _why mirror
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published