reverse Jython

M

Maurice LING

Hi,

I'm looking for a suitable thesis topic, so I hope that I can gather
some advice on this area that I'm thinking of.

Jython appears as a relatively successful attempt to bridge Python to
Java and I find that the best part is that it can convert Python codes
into Java codes. As said in the webpage, it is a python interpreter
written in Java. I am wondering if it is worth reversing this, that is,
a Java interpreter implemented in Python?

A Google search comes up with JPI and PyJava.

Is this still a viable area to look into or it is too done?

Any suggestions?

Thanks
Maurice
 
M

Mark Asbach

Hi Maurice
I am wondering if it is worth reversing this, that is, a Java interpreter
implemented in Python?

Why?

Jython makes sense because you free Python usage from C compilation and
platform issues (regarding extension modules) while still providing
acceptable runtime performance.

The other way round would not cure or help anything.

If you need an interesting topic: why not write a just-in-time compiler
for Python?

There's already some interesting stuff in module "weave" and the pythonc
from Jython, but having a python interpreter use (say) gcc at runtime to
convert and probably optimize Python code to natively executable
binaries, you could speed up Python to the max.

Just my 2 cents,

Mark
 
S

Stefan Behnel

Maurice said:
Jython appears as a relatively successful attempt to bridge Python to
Java and I find that the best part is that it can convert Python codes
into Java codes. As said in the webpage, it is a python interpreter
written in Java. I am wondering if it is worth reversing this, that is,
a Java interpreter implemented in Python?

If you /ask/ if it's worth doing it, then maybe it is not worth doing it
for you?

I personally can't think of a use for such a system, but I know that it
would be quite an effort to get it running, though the JVM itself was
designed to be not that complex.

What would be the advantage over a bridge through the JNI?

Stefan
 
C

Carlos Ribeiro

Hi,

I'm looking for a suitable thesis topic, so I hope that I can gather
some advice on this area that I'm thinking of.

Jython appears as a relatively successful attempt to bridge Python to
Java and I find that the best part is that it can convert Python codes
into Java codes. As said in the webpage, it is a python interpreter
written in Java. I am wondering if it is worth reversing this, that is,
a Java interpreter implemented in Python?

A Google search comes up with JPI and PyJava.

Is this still a viable area to look into or it is too done?

If you dont' _need_ to include Java in your thesis, why not help with
PyPy? It's the Python interpreter written in Python. It's regarded as
a important piece of software for experimentation with the Python
language itself. Give it a look:

http://codespeak.net/pypy/index.cgi?home

p.s. There is a rumour that the PyPy team secretly believes that they
can make it run *faster* than CPython. Does it makes it a good thesis?
;-)


--
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: (e-mail address removed)
mail: (e-mail address removed)
 
M

Maurice LING

If you need an interesting topic: why not write a just-in-time compiler
for Python?

JIT compiler for python sounds cool and I can see that it is an area of
optimization by itself. However, my inadequacy in C and C++ will result
in a poor piece of work, I think.

Maurice
 
M

Maurice LING

If you dont' _need_ to include Java in your thesis, why not help with
PyPy? It's the Python interpreter written in Python. It's regarded as
a important piece of software for experimentation with the Python
language itself. Give it a look:

http://codespeak.net/pypy/index.cgi?home

p.s. There is a rumour that the PyPy team secretly believes that they
can make it run *faster* than CPython. Does it makes it a good thesis?
;-)

PyPy, given the secret belief, will make a good project, on-going
project, collaboration project. The problem lies with the nature of a
thesis work or any academic project, what academics aims for is to
publish papers, get money and work on an area.

With a large project like PyPy, the dynamics of academic research breaks
down as it is real tough to carve a boundary of that you want to do. For
example, if I say (announce on usenet) that I am working import
mechanism, I will be hoping that nobody in this world will write the
same thing before I am done with my thesis. If someone did that before
me, then the chances of publishing my work drops to near zero. In the
end, I'll be doing a one-man chase, not unlike running behind a
MacClaren and trying to catch it...... This is why although PyPy is an
important piece of work and by achieving that (even slower than Jython)
will be a proof of concept of python's completeness, it is not quite
suitable as an part of academic work. Not to mention that it is near
impossible to get developers' documentation (the rationale behind each
function and classes)......

This may be why academic research tends towards obscurity, at least
then, I'll be walking with fellow tortoises and able to enjoy my coffee
with biscotti, rather than running against a train. This may be why
universities can develop new OS and new languages etc etc, because it
fits into the dynamics of academic research and if your project is as
untouched by the world as possible, your stress level drops. On this
light, there is a group in University of Washington (I think) that is
still working on putting type information into assembly language. Pardon
my ignorance here but ask some researchers on the use of their work and
it may boil down to academic curiosity.

I do not need to add Java into my thesis but I am trying to use it to
brush up my Java skills (I hope). Perhaps I am dreaming of a world that
anything can be written in any programming language (even multiple
languages in a same script... how many times we get questions like...
Can Python do ____?) and run on any machines with similar
efficiencies... But then, maybe reversing the Tower of Babel is
impossible...

Maurice
 
M

Maurice LING

Mark said:
If you need an interesting topic: why not write a just-in-time compiler
for Python?

There's already some interesting stuff in module "weave" and the pythonc
from Jython, but having a python interpreter use (say) gcc at runtime to
convert and probably optimize Python code to natively executable
binaries, you could speed up Python to the max.
I think another issue here is that Python bytecode is not stable, as
everyone had said it. So unless a specification on that is present,
implementing JIT compiler for Python is futile... in my opinions.

maurice
 
M

Mike Meyer

Maurice LING said:
Perhaps I am dreaming of a world that anything can be written in any
programming language (even multiple languages in a same
script... how many times we get questions like... Can Python do
____?) and run on any machines with similar efficiencies... But
then, maybe reversing the Tower of Babel is impossible...

I thought we were already there. Every language I know of talks to C,
so you can glue multiple languages together with C. I once did a
project that had a single program that included FORTRAN, C, Python and
TCL code.

<mike
 
A

Alex Martelli

Maurice LING said:
I think another issue here is that Python bytecode is not stable, as
everyone had said it. So unless a specification on that is present,
implementing JIT compiler for Python is futile... in my opinions.

Nah - just call it "a JIT compiler for Python 2.4". If there are minor
bytecode changes in 2.5, it will be correspondingly minor to adjust the
JIT. And you can start with the body of work (previous art) already
present in psyco and in the pypy project -- indeed since they're open
source you can build on top of either or both; psyco's dormant, but
pypy's quite active and you may end up fruitfully cooperating with pypy
people (we _ARE_ extremely open to community participation!!!) among
which is Armin Rigo, psyco's author. pypy minimizes issues due to
unfamiliarity with C -- it uses pyrex as a backend.

If you're keen to remain in the Java/JVM world for whatever reasons,
there may be interesting work in helping complete Jython _AND_ ensuring
it cooperates smoothly with JVM JIT's (I hear it doesn't, so far, but
this IS just hearsay -- I know nothing of the issue). Not sure this is
easy to package up as a thesis topic. Another possibility would be to
work on Python/Eclipse integration -- there's quite a lot of previous
art and some projects may be ongoing, but that is one extremely useful
wide set of tasks which look like they'd be suitable for packaging up a
thesis topic from.


Alex
 
A

Alex Martelli

Maurice LING said:
MacClaren and trying to catch it...... This is why although PyPy is an
important piece of work and by achieving that (even slower than Jython)
will be a proof of concept of python's completeness, it is not quite
suitable as an part of academic work. Not to mention that it is near
impossible to get developers' documentation (the rationale behind each
function and classes)......

The latter is an aspect on which we _definitely_ plan to do much better
in the future, btw -- we have ambitious projects for dissemination of
information, enhanced documentation, easing the use of pypy for all sort
of teaching and research support. But that doesn't resolve your issue
wrt the "suitable as part of academic work" (=="detached from real-world
usefulness"); we definitely DO plan to be real-world meaningful!-)


Alex
 
M

Maurice LING

The latter is an aspect on which we _definitely_ plan to do much better
in the future, btw -- we have ambitious projects for dissemination of
information, enhanced documentation, easing the use of pypy for all sort
of teaching and research support. But that doesn't resolve your issue
wrt the "suitable as part of academic work" (=="detached from real-world
usefulness"); we definitely DO plan to be real-world meaningful!-)

Please don't get me wrong. Academic work need not be detached from
real-world usefulness, in fact, academic work should have the potential
to solve real-world problems. I guess it is the time. I think that
academics should tackle real-world issues when a self-sustaining level
of core competency is there. It is certainly more difficult to craft an
academic question out of a real-world situation than to craft one out of
nothing. The latter can even be a case of grabbing a hypothetical
question from a text-book...

maurice
 
A

Andrew Dalke

Maurice said:
Please don't get me wrong. Academic work need not be detached from
real-world usefulness, in fact, academic work should have the potential
to solve real-world problems.

The trick is knowing which research has the potential.

The example I like best is research into primes. It had
over 2000 years of study before its practical use in
cryptography.

Was there another practical use of primes before the mid-1900s?
Neal Stephenson's Baroque Cycle suggests unique prime
decomposition was used as a basis for information management,
but I don't know if that was real, much less practical.

Andrew
(e-mail address removed)
 
A

Alex Martelli

Maurice LING said:
Please don't get me wrong. Academic work need not be detached from
real-world usefulness, in fact, academic work should have the potential
to solve real-world problems. I guess it is the time. I think that
academics should tackle real-world issues when a self-sustaining level
of core competency is there. It is certainly more difficult to craft an
academic question out of a real-world situation than to craft one out of
nothing. The latter can even be a case of grabbing a hypothetical
question from a text-book...

Hypothetical questions in good textbooks can be great ways to lead one
onto new ways of thinking, that's for sure.

But... it's said that Plato was once asked by a student, what good was
all this geometry they had to study (Plato made all students study
geometry first, as the best preparation of the mind for philosophy).
Plato called a slave and instructed him to give the student a gold coin
then throw the student out of the school.

There remains in academia an unconfessed sympathy for the Greek
position, exemplified by this anecdote, that real scholarship
_shouldn't_ be "good for something" -- it should be far from the grubby
preoccupation of everyday life, and in its own idealized spiritual
sphere. Nobody in academia will speak this out loud, but, it IS, to
some extent, still in the background.

That's why some of us aren't in academia, often having tried it but
found it wanting, partly because of that. The concept of something I've
done being actually practically useful to some people in their everyday
work, in their everyday life, is too important for me to give up.
Doesn't mean I can't explore blue-sky notions, but there's gotta be some
kind of hope that -- at least if I get real lucky and everything comes
out just right -- it WILL be useful. That's why I'm an engineer, not a
scientist, I guess;-).


Alex
 
A

Andrew Dalke

Alex Martelli:
There remains in academia an unconfessed sympathy for the Greek
position, exemplified by this anecdote, that real scholarship
_shouldn't_ be "good for something" -- it should be far from the grubby
preoccupation of everyday life, and in its own idealized spiritual
sphere. Nobody in academia will speak this out loud, but, it IS, to
some extent, still in the background.

Some are in academia in part because it's easier to fail,
or at least fail in interesting ways. I don't mean that
derisively. Consider someone doing work in biochemistry
or genetic research where there are many fundamental
problems that need to be addressed and novel instruments
created before figuring out if a given approach is "good
for something."

It's harder for non-academics to justify this sort of
exploratory work.

BTW, I happen to believe too much basic research is shifted to
academic labs and I complain that as a consequence in the US
it means a single person, the president, can decide that
certain fields of research are prohibited.


Andrew
(e-mail address removed)
 
M

Maurice LING

But... it's said that Plato was once asked by a student, what good was
all this geometry they had to study (Plato made all students study
geometry first, as the best preparation of the mind for philosophy).
Plato called a slave and instructed him to give the student a gold coin
then throw the student out of the school.

There remains in academia an unconfessed sympathy for the Greek
position, exemplified by this anecdote, that real scholarship
_shouldn't_ be "good for something" -- it should be far from the grubby
preoccupation of everyday life, and in its own idealized spiritual
sphere. Nobody in academia will speak this out loud, but, it IS, to
some extent, still in the background.
It reminds me of my convocation ceremony last year and a certain sense
of disbelieve when someone was conferred a PhD in Arts for his work to
"study the numerous bloody scenes of Iliad by Homer." There is a notion
that academics lives in ivory towers...... But considering the life
histories of some philosophers, Immanuael Kant for example (I think),
he's born a nobleman......

I suppose pure mathematicians are still the subscribers to the ancient
notion of real scholarship, considering they do maths just to produce
more maths. Applied mathematicians are the ones that brought us computers...
That's why some of us aren't in academia, often having tried it but
found it wanting, partly because of that. The concept of something I've
done being actually practically useful to some people in their everyday
work, in their everyday life, is too important for me to give up.
Doesn't mean I can't explore blue-sky notions, but there's gotta be some
kind of hope that -- at least if I get real lucky and everything comes
out just right -- it WILL be useful. That's why I'm an engineer, not a
scientist, I guess;-).

I do find more and more academics subscribing to the concept of
real-world use (if lucky). Even though I am a scientist, I cant really
handle obscurity, working in my own sphere of my own creation.
Otherwise, I won't even have asked the question of "is it worth
reversing jython, to compile java into python?" in the first place. In
the notion of real scholarship, it is a nice thought, nobody had done it
or is doing it, why even question the validity...

maurice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top