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
- 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.