Java version of Python, Jython

Source: Internet
Author: User

Today, I suddenly found a script language called Jython, which is a python implemented in Java.

Let's take a look at the differences between them.

Original reference address http://wiki.python.org/jython/WhyJython
Why Jython?

Currently, many languages implement Java VM. The following introduction separates the implementations of other Jython languages:

  • Dynamically compiled into Java bytecode
  • Extends Java's original class capabilities
  • Multiple types of programs can be created
  • Attributes With bean
  • Python syntax

Why does Jython do well?

  • Prototyping
  • Java Investigation
    •     >>> from java.util import Date
      >>> d = Date()
      >>> print d
      Sat Jan 08 16:26:16 CST 2005
      >>> from java.util import Random
      >>> print dir(Random)
      ['__init__', 'nextBoolean', 'nextBytes', 'nextDouble', 'nextFloat',
      'nextGaussian', 'nextInt', 'nextLong', 'seed', 'setSeed']
      >>>
  • Making bean properties accessible
    •     >>> print Date().time
      1105500911121
  • Glues together libraries already written in Java
  • Excellent embedded scripting language
    • Object domain UML Tool
    • Pushtotest

    • Drools

Differences between Python and Jython

Python

  • C
  • Multi-platform
  • Compiles to. PyC
  • Extend with C
  • Gil 1

  • Python garbage collection

Jython

  • Java 100%
  • Any JVM (currently 1.1 +)
  • Compiles to. Class
  • Extend with Java
  • Truly multi-threaded
  • Java garbage collection

Seeing the above, I can't help but admire those who have quietly contributed to the software.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.