1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/docs/index.html Fri Jan 21 17:04:41 2005 +0100
1.3 @@ -0,0 +1,67 @@
1.4 +<?xml version="1.0" encoding="iso-8859-1"?>
1.5 +<html xmlns="http://www.w3.org/1999/xhtml">
1.6 +<head>
1.7 + <title>ClassFile</title>
1.8 + <meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
1.9 + <link xmlns:xlink="http://www.w3.org/1999/xlink" href="styles.css"
1.10 + rel="stylesheet" type="text/css" />
1.11 +</head>
1.12 +
1.13 +<body>
1.14 +<h1>ClassFile</h1>
1.15 +
1.16 +<p>The ClassFile collection of packages and utilities provides a means of
1.17 +importing Java classes and packages directly into Python, without the need
1.18 +for a Java virtual machine, so that the classes may be instantiated,
1.19 +accessed, run and manipulated just like Python classes, and that the
1.20 +resulting objects and methods can be accessed and manipulated just like
1.21 +Python objects and methods.</p>
1.22 +
1.23 +<h2>Quick Example</h2>
1.24 +
1.25 +<p class="prompt">cd tests/</p>
1.26 +
1.27 +<p class="prompt">javac Value.java</p>
1.28 +
1.29 +<p class="prompt">../runclass.py Value</p>
1.30 +
1.31 +<p class="result">v.getValue() correct: 123<br />
1.32 +v.getValue() correct: 456<br />
1.33 +v.isPositive() correct: 1<br />
1.34 +v.isPositive() correct: 0<br />
1.35 +v.compare(-790) correct: -1<br />
1.36 +v.compare(-788) correct: 1<br />
1.37 +v.compare(-789) correct: 0<br />
1.38 +v.getValue() == v2.getValue() correct: 0<br />
1.39 +v2.add(-123) correct: 0<br />
1.40 +v2.getValue() correct: 255</p>
1.41 +
1.42 +<p class="prompt">java Value</p>
1.43 +
1.44 +<p class="result">v.getValue() correct: 123<br />
1.45 +v.getValue() correct: 456<br />
1.46 +v.isPositive() correct: true<br />
1.47 +v.isPositive() correct: false<br />
1.48 +v.compare(-790) correct: -1<br />
1.49 +v.compare(-788) correct: 1<br />
1.50 +v.compare(-789) correct: 0<br />
1.51 +v.getValue() == v2.getValue() correct: false<br />
1.52 +v2.add(-123) correct: 0<br />
1.53 +v2.getValue() correct: 255</p>
1.54 +
1.55 +<h2>Motivation</h2>
1.56 +
1.57 +<p>Pick one of the following:</p>
1.58 +<ul>
1.59 + <li>The need/desire to access Java libraries from Python without firing up
1.60 + Java virtual machines or switching to Jython (and thereby losing access
1.61 + to various CPython libraries).</li>
1.62 + <li>Static typing for the Python environment, albeit achieved by writing
1.63 + Java or other appropriate languages.</li>
1.64 + <li>Having an open source environment from top to bottom to run Java
1.65 + bytecode on.</li>
1.66 + <li>Experimentation around import hooks, bytecode generation; observation
1.67 + of different runtime and type systems interacting.</li>
1.68 +</ul>
1.69 +</body>
1.70 +</html>