Differences between revisions 2 and 3
Revision 2 as of 2005-02-05 02:40:28
Size: 2345
Editor: BillDehora
Comment:
Revision 3 as of 2005-02-05 02:42:35
Size: 2359
Editor: BillDehora
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:


Line 50: Line 53:
Line 56: Line 60:
----

Jython, lest you do not know of it, is the most compelling weapon the Java platform has for its survival into the 21st century - SeanMcGrath


Why Jython

There are numerous [http://grunge.cs.tu-berlin.de/~tolk/vmlanguages.html alternative languages] implemented for the Java VM. The following features help to separate Jython from the rest:

  • Dynamic compilation to Java bytecodes - leads to highest possible performance without sacrificing interactivity.
  • Ability to extend existing Java classes in Jython - allows effective use of abstract classes.
  • Optional static compilation - allows creation of applets, servlets, beans, ...
  • Bean Properties - make use of Java packages much easier.
  • Python Language - combines remarkable power with very clear syntax. It also supports a full object-oriented programming model which makes it a natural fit for Java's OO design.

What Does Jython Do Well?

  • Protyping
  • 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']
          >>>
  • Bean properties accesible
    •     >>> print Date().time
          1105500911121
  • Glue together libraries already written in Java
  • Excellent embedded scripting language


Differences - Python & Jython

Python

  • C
  • Multi-platform
  • Compiles to .pyc
  • Extend with C
  • GIL
  • Python Garbage Collection

Jython

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

WhyJython (last edited 2015-04-30 17:58:58 by JimBaker)