> I am one of the developers working on a scientific data reduction
> and analysis system (http://aips2.nrao.edu/). We currently use
> a language called Glish (http://aips2.nrao.edu/docs/glish/glish.html)
> that we adopted from the remains of the SSC. We are considering:
> (1) adopting Python as our scripting language
> (2) porting Glish to Java (mainly for for legacy apps)
> My question to you is would it make sense to attempt to use the
> internal jython classes, e.g. PyDictionary, as the internal data
> structures for jGlish? This could perhaps allow jGlish and Jython
> to interoperate. I think this could likely be a bad idea. However,
> if you could offer any suggestions or advice, I'd appreciate
> hearing them.
I skimmed through the Glish docs a bit.
A first and probably not very reliable impression:
The main differences with Python seem to be the Glish event
together with the Glish 'whenever' statement, and the more
extensive array slicing in Glish.
In case you want to avoid writing a parser in java for Glish
(even though javacc makes this more or less straightforward)
you might consider writing a python generator using your
existing Glish parser. Then you could really reuse a lot
of the underlying Python implementation.
The details of Python and Glish might still make this quite
a bit of work as both languages are not small. However, many of the
Glish concepts seem to map without much 'impedance' to Python.
(In case Glish is really more statically typed than Python, you
might also directly generate Java (byte code) from Glish.)
Most of the remaining work would then consist of closing the semantic
gaps of the 'whenever' statement and of the Glish slicing.
In case you can close these gaps in pure Python this
might allow for a Glish implementation on top of either
Jython or CPython. As I have no idea how useful CPython might be
for you, please have a look at the page on the jython website describing
the differences between CPython and Jython.
About making jGlish and Jython interoperate: you might also reuse
the way Jython interoperates with Java. Then you can call
Jython from jGlish via Java, and vice versa. In case you
generate Jython code from Glish code, you'll get the interaction
Glish - Java at very little cost.
Mapping Glish to Python has the advantage that most of the code
you'll write will be written either in the language of the parser
generating python or in python itself. Since one can be quite
productive in python, this approach is probably ok to start an
'exploring prototype'. For legacy code, such a prototype might
also turn out to be just good enough.