2

RustPython:用Rust编写的开源Python 3解释器

 3 months ago
source link: https://www.jdon.com/72390.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

RustPython:用Rust编写的开源Python 3解释器

RustPython 是一个用 Rust 编写的 Python 解释器。RustPython 可以嵌入到 Rust 程序中,以使用 Python 作为应用程序的脚本语言,也可以将其编译为 WebAssembly,以便在浏览器中运行 Python。RustPython 在 MIT 许可下是免费且开源的。

为什么选择 RustPython?
Python 有很多实现。例如:

  • CPython(C),这是最常见的
  • Jython(Java
  • IronPython (.NET)
  • PyPy(Python)
  • Stackless

这些实现都有一些优点:例如,Jython 将 Python 2 源代码编译成 Java 字节码,然后将其路由到 Java 虚拟机。由于 Python 代码被翻译成了 Java 字节码,因此在运行时看起来和感觉上都像一个真正的 Java 程序,因此能很好地与 Java 应用程序集成。

IronPython 与 .NET 完美集成,这意味着 IronPython 可以使用 .NET 框架和 Python 2 库,反之亦然。

我们希望为 Rust 编程语言提供与 Jython 和 IronPython 相同的可能性。此外,得益于 Rusts 的最小运行时,我们能够将 RustPython 编译成 WebAssembly,让用户在浏览器中轻松运行 Python 代码。

安装
cargo install --git https://github.com/RustPython/RustPython
wapm install rustpython
conda install rustpython -c conda-forge


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK