Hi Quinn -
Gremlin-JavaScript has been discussed as a Gremlin variant many would like to see (along with Gremlin-Jython and Gremlin-Clojure).
All Gremlin variants use Gremlin-Java as their base, and each essentially would wrap Gremlin-Java like Gremlin-Groovy does.
Last year I worked on the Neo4j Sever JavaScript plugin -- there is no Gremlin-JavaScript yet so the goal was to make Gremlin-Java work with a JavaScript engine.
There are several different JavaScript engines -- there is an old version that comes standard with the JDK, and there are newer Rhino versions, including a rhino-nonjdk version which we ended up using, but Rhino is still old and not without its issues.
You can see my comments regarding this issue here:
And you can look at the pom.xml to see which version we ended up using (the lib directory includes the jar files):
If someone is interested in working on Gremlin-JavaScript, you probably want to target Nashorn since it's the future, and according to the InfoQ article, it looks like there will be Nashorn + Node.jar integration.
You can get an idea of what Gremlin-Java-in-JavaScript looks like by viewing these test cases for the Neo4j Server JavaScript Plugin:
Note that some of the code is Neo4j Server specific (such as the manual imports in the scripts), but you can ignore those.
In the Neo4j Plugin, "pipe" (com.tinkerpop.gremlin.java.GremlinPipeline) and "g" (com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph) instances are automatically set, just like "g" is automatically set in the Rexster Gremlin-Groovy extension.
In Gremlin Java, you always start with an instance of GremlinPipeline.
For example, see:
Again, this is not Gremlin-JavaScript -- this is Gremlin-Java in JavaScript -- but if you were to create Gremlin-JavaScript, you would wrap the Gremlin-Java methods in a JavaScript-idiomatic way.
- James