I think they desire to use the same 'code' for both local and remote graphs. Secondarily, I think there's a concern that cached, parameterized scripts are more performant than bytecode (parameterized or not).
First, both scripts and traversals can actually be used locally and remotely.
You can put this into gremlin console to try.
import org.apache.tinkerpop.gremlin.jsr223.CachedGremlinScriptEngineManager
manager = new CachedGremlinScriptEngineManager();
engine = manager.getEngineByName("gremlin-groovy");
bindings = engine.createBindings();
bindings.put("g", g);
bindings.put("s", "marko");
engine.eval("g.V().has('name',s)", bindings).next()
==>v[1]
Obviously, you can execute the same script remotely via gremlin-server using the client api to submit it.
Alternatively, native traversals can be used with or without bindings, locally and remote.
// local bindings
graph = TinkerFactory.createModern()
g = graph.traversal()
b = Bindings.instance()
g.V().has('name',b.of('x','marko'))
==>v[1]
// remote bindings
graph = EmptyGraph.instance()
g = graph.traversal().withRemote('conf/remote-graph.properties')
b = Bindings.instance()
g.V().has('name',b.of('x','marko'))
==>v[1]
Bytecode with bindings can't be cached and I'm not sure what value they provide. However, bytecode without bindings is the fastest option there is. See
this thread.
I probably wouldn't go to scripts unless there is work other than traversals that must be executed remotely. Of course, you'll have to benchmark your use cases.