bsh

Just out of curiosity, why does VASSAL have a bsh library in it? And is that some bsh source code I see in VASSAL? (Like what the heck is up with including a generated Parser.java file?) Couldn’t we just get the bsh functionality we need from a jar?

-K

Thus spake fil512:

Just out of curiosity, why does VASSAL have a bsh library in it? And is
that some bsh source code I see in VASSAL? (Like what the heck is up
with including a generated Parser.java file?) Couldn’t we just get the
bsh functionality we need from a jar?

There is a JAR for BeanShell. I don’t know the reason we’re not using it.
Brent can comment on this, as BeanShell support is one of his projects.


J.

*********** REPLY SEPARATOR ***********

On 16/08/2010 at 11:26 AM fil512 wrote:

Just out of curiosity, why does VASSAL have a bsh library in it?

Beanshell

And is that some bsh source code I see in VASSAL? (Like what the heck is up
with including a generated Parser.java file?)

Because I have modified the Beanshell parser.

Couldn’t we just get the bsh functionality we need from a jar?

We do, bsh.jar. However, it did not do quite want we wanted and required some tweaks.

Modifying generated code sounds risky. Does VASSAL need a full Java interpreter? Would something lighter, like jep, or rhino suffice?

*********** REPLY SEPARATOR ***********

On 16/08/2010 at 2:35 PM fil512 wrote:

“swampwallaby” wrote:

Couldn’t we just get the bsh functionality we need from a jar?

We do, bsh.jar. However, it did not do quite want we wanted and
required some tweaks.

Modifying generated code sounds risky.

I don’t modify generated code, I modify the parse tree and regenerate the automatically generated modules.

Does VASSAL need a full Java interpreter?

Yes, I believe so. This has been discussed off and on for several years.

Would something lighter, like jep, or rhino suffice?

I consider Beanshell to be light. I have used JEP and it is fairly limited.

There are advantages to having a Java scripting language sitting behind a Java application.

Would something lighter, like jep, or rhino suffice?

I was not previously aware of Rhino, and a quick look indicates it may be a better choice than Beanshell. Rhino is included in JRE6, whereas Beanshell development has stalled. The dynamic variable typing of Javascript is also a better match to the way Vassal works than straight Java, and simpler to pick up.

Actually, Beanshell2 is still pretty active here.

The choice to make seems to be between Java and Javascript. Which is the more established language? Which is easier to work with? Which is more widely known? Object-oriented ease? Type ease?

In any case, I believe we can write functions or libraries to let module designers work easier and more efficiently. There really isn’t any real disadvantage to either language. Both have same scope mechanisms (I think, not so familiar with Javascript).

Well, the choice is made and implemented, so it is a moot point.

You can start the discussion again with Vassal 4.

Thus spake viewofheaven:

Actually, Beanshell2 is still pretty active here[1].

The choice to make seems to be between Java and Javascript. Which is the
more established language? Which is easier to work with? Which is more
widely known? Object-oriented ease? Type ease?

In any case, I believe we can write functions or libraries to let module
designers work easier and more efficiently. There really isn’t any real
disadvantage to either language. Both have same scope mechanisms (I
think, not so familiar with Javascript).

JavaScript is a nasty, nasty langauge. It has global scoping, which is
frustrating, and an object model which is very little like what we have
on the Java side. JavaScript is not something I would want to put myself
in a position to have to explain to users. Among our users who are
programmers, I would bet that far more of them will have used Java than
JavaScript.


J.