与 CPython、Jython 和 IronPython 相比,PyPy 能提供什么?
从我在博客上看到和读到的内容来看,PyPy 是一个非常雄心勃勃的项目。 与它的兄弟姐妹(CPython、Jython 和 IronPython)相比,它会带来哪些优势? 是速度、跨平台兼容性(包括移动平台)、在没有 GIL 的情况下使用 c 扩展的能力,还是这更多的是关于可以做什么的技术练习?
From what I have seen and read on blogs, PyPy is a very ambitious project. What are some advantages it will bring to the table over its siblings (CPython, Jython, and IronPython)? Is it speed, cross-platform compatibility (including mobile platforms), the ability to use c-extensions without the GIL, or is this more of a technical exercise on what can be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
PyPy 实际上是两个项目:
这些两个项目可以实现很多事情。
因此,PyPy 确实有很多令人兴奋的理由,而且它终于开始兑现其所有承诺。
PyPy is really two projects:
These two projects allow for many things.
So there are really a lot of reasons for PyPy to be exciting, and it is finally starting to live up to all its promises.
最重要的功能当然是 JIT 编译器。 在 CPython 中,文件被编译为字节码 (
.pyc
) 或优化字节码 (.pyo
),然后进行解释。 使用 PyPy,它们将被编译为本机代码。 PyPy 还包含 Stackless Python 补丁,其中包括令人印象深刻的 功能(tasklet 序列化、轻线程等)The most important feature is of course the JIT compiler. In CPython files are compiled to bytecode (
.pyc
) or optimized bytecode (.pyo
) and then interpreted. With PyPy they will be compiled to native code. PyPy also includes Stackless Python patches, including it's impressive features (tasklet serialization, light threads etc.)如果 Python 获得真正的 JIT 我认为它会一样快与任何其他实现一样。
优点是更容易实现新功能。 今天通过观察图书馆就可以看到这一点。 通常模块首先用 Python 编写,然后翻译成 C。
In case that Python gets a real JIT I think it's going to be as fast as any other implementation.
The advantage is that it's much easier to implement new features. One can see this today by observing the library. Often modules are written in Python first and then translated into C.
是
Yes