是否可以集成 Python(和/或 Perl)和 Ruby?我看过http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/ http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/ and http://code.google.com/p/ruby-perl/ http://code.google.com/p/ruby-perl/,但它们看起来都相当过时了。
有人为 Python 的 C API 生成了 Ruby 接口吗?
编辑:Python 可以根据以下内容与许多其他语言集成http://wiki.python.org/moin/IntegratingPythonWithOtherLanguages http://wiki.python.org/moin/IntegratingPythonWithOtherLanguages。但是,该列表不包括 Ruby。
我的学校(佐治亚理工学院)与 Bryn Mawr 和微软研究院一起正在开展一个项目,名为Pyjama http://wiki.roboteducation.org/Pyjama。基本上,它使用 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"
生成“Python 向 Ruby 打招呼”。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)