Jython requires programmers to learn Java development too
Jython要求程序员也要学习Java开发
Language syntax is only one aspect of programming. The library skew mentioned previously is just one example of Jython's dependence on the Java system. Not only do you need to learn Java libraries to get real work done in Jython, but you also must come to grips with the Java programming environment in general.
语法仅是编程的一方面。前面所提的库交叉只是Jython依赖于Java系统的一个例子。为了能用Jython完成实际工作,你不仅需要学习Java库,你还必须掌握通常的Java编程环境。
Most standard Python libraries have been ported to Jython, and others are being adopted regularly. But major Python tools such as Tkinter GUIs may show up late or never in Jython (and instead are replaced with Java tools).[*] In addition, many core Python library features cannot be supported in Jython, because they would violate Java's security constraints. For example, some tools in the os module may never become available in Jython.
大多数标准Python库已经移植到Jython,并且其它的库也正在定期地被采纳。但是主要的Python工具,例如Tkinter GUI,可能要晚点才出来,也可能永远不会在Jython中出现(并被Java工具所替代)。[*] 还有,Jython不支持核心Python库中的许多特性,因为它们违反Java的安全性约束。例如,Jytnon不能使用os模块中的一些工具。
[*] But see the note at the end of the later section "Grail: A Python-Based Web Browser"; a port of Tkinter for Jython known a jTkinter is available. Search the Web for details.
[*] 但是有一个Tkinter的移植jTkinter,见下面“Grail: 基于Python的网页浏览器”一节结尾处的注释。详情请搜索网络。
Jython applies only where a JVM is installed or shipped
Jython要求JVM的分发与安装
You need the Java runtime to run Jython code. This may sound like a nonissue given the pervasiveness of the Internet, but I have worked in more than one company for which delivering applications to be run on JVMs was not an option. Simply put, there was no JVM to be found at the customer's site. In such scenarios, Jython is either not an option, or it will require you to ship a JVM with your application just to run your compiled Jython code.
你需要Java运行库才能运行Jython代码。由于因特网的普遍性,这可能不成问题,但是我工作过的公司中,不止一家,交付的应用程序运行于无法安装 JVM的环境。最简单的,如客户机没有JVM。这种情况下,要么不选Jython,要么需要与应用程序同时分发JVM,这样才能运行你编译的Jython 代码。
Shipping the standard Python system with your products is completely free; shipping a JVM may imply licensing and fee issues (though open source options do now exist). On some platforms, finding a JVM to use for development might be an issue as well; see http://www.jython.org for current JVM compatibility issues.
你的产品附带分发标准Python系统是完全免费的;分发JVM可能有许可和费用问题(尽管现在有开源的选择)。在有些平台上,寻找一个开发用的JVM,可能也是个问题;上http://www.jython.org查看当前的JVM兼容问题。
Jython doesn't support Python extension modules written in C or C++
Jython不支持C或C++写的Python扩展模块
At present, no C or C++ extension modules written to work with the C Python implementation will work with Jython. This is a major impediment to deploying Jython outside the scope of applications run in a browser. To date, the Python user community has developed thousands of extensions written for C Python, and these constitute much of the substance of the Python development world.
目前,为C Python而写的C或C++模块没有一个能工作于Jython。这是部署Jython的主要障碍,浏览器应用除外。到目前为止,Python用户群已经开发了成千上万的为C Python而写的扩展,并且以此形成了Python开发世界的大量物质。
Jython's current alternative is to instead expose Java class libraries and ask programmers to write new extensions in Java. But this dismisses a vast library of prior and future Python art. In principle, C extensions could be supported by Java's native call interface, but it is complex and can negate Java portability and security.
Jython的当前的方法是让程序员们用Java重写扩展,并输出Java类库。但这样就抛弃了大量历史的和将来的Python库。原则上,C扩展可以被Java的本地调用接口所支持,但它是复杂的并且会降低Java的可移植性与安全性。
Jython is noticeably slower than C Python
Jython明显的比C Python慢
Today, Python code generally runs slower under the Jython implementation. How much slower depends on what you test, which JVM you use to run your test, whether a Just-in-Time (JIT) compiler is available, and which tester you cite. Posted benchmarks have run the gamut from 1.7 times slower than C Python, to 10 times slower, and up to 100 times slower. Regardless of the exact number, the extra layer of logic Jython requires to map Python to the Java execution model adds speed overheads to an already slow JVM and makes it unlikely that Jython will ever be as fast as the C Python implementation.
目前,Python代码在Jython下运行一般比较慢。慢多少取决于测试的内容,运行的JVM,是否有即时编译器(JIT),以及所使用的测试器。发布的基准数据显示,它比C Python慢1.7到10倍,最高可达100倍。不管具体的数字,为了将Python映射为Java执行模型,需要额外的Jython逻辑层,这增加了速度上的开销,而且JVM本身就慢,所以Jython不太可能像C Python那么快。
Given that C Python is already slower than compiled languages such as C, the additional slowness of Jython makes it less useful outside the realm of Java scripting. Furthermore, the Swing GUI library used by Jython scripts is powerful, but generally is considered to be the slowest and largest of all Python GUI options. Given that Python's Tkinter library is a portable and standard GUI solution, Java's proprietary user-interface tools by themselves are probably not reason enough to use the Jython implementation.
C Python已经比编译性语言如C语言要慢,Jython所附加的慢速使它只能用于Java脚本领域。另外,Jython脚本所用的Swing GUI库虽然很强大,但普遍认为,它是所有Python可选GUI中最大型最慢的。虽然Python的Tkinter库是一个可移植和标准的GUI解决方案,但Java自有一套用户界面工具,可能没有足够理由要去使用Jython实现的Tkinter。
Jython is less robust than C Python

