News: Go to the wiki and do the Flying Ship tutorial May 22, 2012, 02:13:07 pm
Welcome, Guest. Please login or register. *

Rhino - Javascript for Java
Pages: 1
  Send this topic  |  Print  

  Rhino - Javascript for Java
Author Message
0 Members and 2 Guests are viewing this topic.
2playgames
OpenWar Project Founder
Administrator
Sr. Member
***
Offline Offline

Posts: 857


Busy busy busy busy busy


View Profile WWW
« on: February 04, 2008, 12:33:18 am »

http://www.mozilla.org/rhino/

Just thought I'd post this here. Rhino is an open-source library for embedding javascript support in your Java applications. We'll definitely need scripting in our projects, so this is an interesting resource. I don't know how usable it will be yet, particularly I wonder how good we can conceal our Java internals from scripts (e.g. does it access objects and methods directly, or do we make some kind of mapping), but we should research that, before writing our own script system.
Logged




Darvin
OpenWar Staff
Staff
Sr. Member
**
Offline Offline

Posts: 506


The Concept and Design King


View Profile
« Reply #1 on: February 04, 2008, 08:45:42 am »

Good find; definitely worth looking into further, and if it meets our needs, by all means we can use it.
Logged
2playgames
OpenWar Project Founder
Administrator
Sr. Member
***
Offline Offline

Posts: 857


Busy busy busy busy busy


View Profile WWW
« Reply #2 on: February 04, 2008, 06:27:48 pm »

Another options is BeanShell, which is approximately the same, except it uses Java syntax, which owns JS any day
Logged




2playgames
OpenWar Project Founder
Administrator
Sr. Member
***
Offline Offline

Posts: 857


Busy busy busy busy busy


View Profile WWW
« Reply #3 on: February 07, 2008, 01:16:25 am »

I've checked out both options, but so far Rhino seems the best choice (even if Java is better than JS). BeanShell can access our classes and objects very directly, while Rhino allows us to hide a lot of things from scripts, or give them different names. Rhino also easily lets you set the scope of a script (e.g. globally or just within the object or action).
Logged




Darvin
OpenWar Staff
Staff
Sr. Member
**
Offline Offline

Posts: 506


The Concept and Design King


View Profile
« Reply #4 on: February 07, 2008, 07:43:03 am »

I think Rhino sounds like the better option.  It seems to offer more abstraction, which is really what we need here.  More abstraction means fewer details the script writers need to worry about.
Logged
{IP}Gil-Galad
Guest
« Reply #5 on: May 10, 2008, 03:28:15 am »

pure Java would work fine. Java has classes that can compile and execute a newly compiled class file. If you want more information 2playgames Ill be on msn!

-Phil
Logged
2playgames
OpenWar Project Founder
Administrator
Sr. Member
***
Offline Offline

Posts: 857


Busy busy busy busy busy


View Profile WWW
« Reply #6 on: May 10, 2008, 10:27:01 am »

Hmm, sounds interesting. However, unless I'm mistaken, we can't really use that, because we need the scripts to see a different interface than our own internal classes.
Logged




Darvin
OpenWar Staff
Staff
Sr. Member
**
Offline Offline

Posts: 506


The Concept and Design King


View Profile
« Reply #7 on: May 10, 2008, 10:04:53 pm »

It's a matter of abstraction; we need an extra layer for scripting purposes.
Logged

Pages: 1
  Send this topic  |  Print  
 

Jump to: