Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Alternative Bytecodes for OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Goerzen <jgoerzen@c...>
Subject: Re: [Caml-list] Alternative Bytecodes for OCaml
On Wednesday 25 August 2004 10:05 am, skaller wrote:
> On Thu, 2004-08-26 at 00:26, John Goerzen wrote:
> > I come to OCaml from a Python background, and one of the most
> > interesting bits of technology for Python is Jython[1].
> Curious though why you'd want to... interfacing to C
> I can understand. But why bother with the JVM or Java?

Because you need to do *NOTHING* to get access to Java classes.  The 
Java type system is rich/strict enough (depending on your perspective) 
to be usable directly from Python, with no glue whatsoever.

Also because there are some interesting Java libraries that do not exist 
for C, or are not as easily usable.  JDBC is a common one.

And because Python is cross-platform, Java is, but compiled C is not.  A 
Jython program still can "run anywhere".


$ jython
Jython 2.1 on java1.4.1 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import java.lang.System
>>> p = java.lang.System.getProperties()
>>> for key in p.keySet().toArray():
...    print "%-30s: %s" % (key, java.lang.System.getProperty(key))
...             : Java(TM) 2 Runtime Environment, Standard 
python.cachedir               : /home/jgoerzen/.jython-cache
sun.boot.library.path         : /usr/lib/j2se/1.4/jre/lib/i386
java.vm.version               : Blackdown-1.4.1-beta
java.vm.vendor                : Blackdown Java-Linux Team
java.vendor.url               :
path.separator                : :                  : Java HotSpot(TM) Client VM


I wrote no glue code for this.  It just worked.  And that is the case 
with almost all Java APIs and libraries.  Jython can be used, in fact, 
as an interactive Java environment.

-- John

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: