From: Peter Graves <peter@ar...> - 2003-06-05 19:54:10
On Thu, 5 Jun 2003 at 20:49:23 +0200, Ludovico Magnocavallo wrote:
> ps - a while back I posted a msg to the list about using Jython
> inside J for Python coding, but got no reply. Is it a stupid things
> or do you have any comment/insight on the issue?
Using Jython inside j is a fine idea. It was one of the options I
considered a long time ago before going with BeanShell; I believe the
deciding factor at the time was footprint.
It turns out that I've never heard of anyone writing an extension to j
in BeanShell, although some folks did use (and maybe some folks are
still using) ~/.j/init.bsh to set some options depending on their
environment or tinker with some key mappings.
For writing extensions, I think the bottom line is that if the choice
is between Java and BeanShell, you're better off with Java. BeanShell
is too slow for a non-trivial extension, and in addition it's a tad
BeanShell will no longer be bundled with j after 0.20.0, but I have no
immediate plans to remove the internal support for BeanShell, so folks
will still be able to use BeanShell with j, if they provide their own
J now comes with its own extension language (a version of Lisp), but
it's not quite ready for general use, although the version in 0.19.0.3
can do all of the things that BeanShell was ever advertised to do in
terms of customizing j. (Take a look at init.lisp and key-pressed.lisp
in the examples directory.)
When the grand plan comes together, you'll be able to compile Lisp to
Java byte code, so there will be no performance penalty for writing an
extension in Lisp.
To use Jython, you'd have to write a bit of glue. For BeanShell, that
glue is in BeanShell.java (api.bsh and API.java are also relevant, to
define the officially supported API, which was very minimal); the whole
thing is really very little code. It shouldn't be hard to do the
equivalent thing for Jython.
I'm not going to do it myself, because I'm not really a Jython/Python
user, I don't have any feel for it, and I wouldn't be able to test it
in a meaningful way. But I'd certainly consider a patch that would let
folks use Jython with j, as an option.