是否可以集成Python(和/或Perl)和Ruby?我查看了http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/和http://code.google.com/p/ruby-perl/,但他们两者似乎都过时了.
有人为Python的C API生成了Ruby接口吗?
编辑:根据http://wiki.python.org/moin/IntegratingPythonWithOtherLanguages,Python可以与许多其他语言集成.但是,该列表不包括Ruby.
我的学校(乔治亚理工学院),以及Bryn Mawr和微软研究院,正在做一个名为Pajama的项目.基本上,它使用Microsoft DLR允许您自由地混合Python和Ruby.我没试过,但听起来很酷.
这是网站上的一个例子.您以"Python模式"进入该类.然后它被编译,你在"Ruby模式"下运行命令.
class PythonClass:
def hello(self, value):
print "Python says hello to", value
pc = python_class().new
pc.hello "Ruby"
Run Code Online (Sandbox Code Playgroud)
这产生了"Python向Ruby问好".