编程时使用 Jython

发布于 2024-09-16 05:52:51 字数 168 浏览 1 评论 0原文

我最近开始学习 Python,并遇到了术语 Jython。 从谷歌搜索结果来看,我由此得出结论,这确实是一个非常重要的术语。 使用 Jython 编程/编码是怎样的体验?

I recently started learning Python and came accross the term Jython.
From the Google search results, I thereby concluded that it is indeed a very important term.
What is the experience programming/coding using Jython?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

鯉魚旗 2024-09-23 05:52:51

Jython 只是运行在 JVM(Java 虚拟机)上的 Python 解释器的实现。

什么是 JPython?

JPython 是
Python 编程语言是
设计为在 Java(tm) 上运行
平台。它由一个编译器组成
将Python源代码编译为
可直接运行的Java字节码
在 JVM 上,一组支持库
编译后的 Java 使用的
字节码和额外的支持
使用 Java 包很简单
在 JPython 中。 JPython 已经
已重命名并由 Jython 取代。

因此,Jython 中的编码与 Python 中的编码基本相同;具有访问 Java 库的优势。

阅读:Jython 常见问题解答为什么选择 Jython?

Jython is just an implementation of the Python interpreter that runs on the JVM (Java Virtual Machine).

What is JPython?

JPython is an implementation of the
Python programming language which is
designed to run on the Java(tm)
Platform. It consists of a compiler to
compile Python source code down to
Java bytecodes which can run directly
on a JVM, a set of support libraries
which are used by the compiled Java
bytecodes, and extra support to make
it trivial to use Java packages from
within JPython. JPython has been
renamed and superseded by Jython.

So coding in Jython is the basically same as coding in Python; with the advantage of having access to Java libraries.

Read: Jython FAQ, Why Jython?

傻比既视感 2024-09-23 05:52:51

这不仅仅是访问 Java 库的优势。它还能够在 Java 虚拟机的所有支持和优化(即 JIT 编译)上运行。

Jython 对于编写 Java 应用程序脚本也非常有用。

IronPython 是 .NET CLI 的类似方法

It's not just about the advantage of having access to the Java libraries. It's also being able to run on Java VM's with all their support and optimizations (i.e. JIT compilation).

Jython is also very usefull for scripting Java applications.

IronPython is a similar approach for the .NET CLI

用心笑 2024-09-23 05:52:51

我给您的建议是:忘掉 Jython 和 IronPython。除了初学者和他们的开发人员之外没有人使用它们。至于 Jython,它比 Python(又名 CPython)慢得多,健壮性和可靠性也较差。它没有 Python 那样的大量“电池”;此外,线程、进程和其他较低级别的内部工作方式是不同的,从而导致微妙且难以调试的错误。

My recommendation to you: Forget about Jython and IronPython. Nobody uses them except the beginners and their developers. As for Jython, it's much slower, less robust, and less reliable than Python (aka CPython). It doesn't have the significant number of "batteries" that come Python; moreover, threading, process, and other lower-level inner-workings are different, resulting in subtle and hard-to-debug bugs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文