I'll spend some time looking at sparql-gremlin and sql-gremlin to get a
feel for it.

Regarding implementing gremlin in C,C++, Go, Javascript I can not see
how to do it without the Gremlin language specification itself becoming
completely declarative. I imagine/hope it can still keep its fluent
nature but that 'graphTraversal.out().repeat().this().that()' is no
longer tied to a java Interface but only to a specification.
Unfortunately I am out actually out of my depth here as I have never
written AST parsers or worked anywhere near this field.

However I am imagining the Steps and GraphTraversal to be specified
purely in natural language and that the TinkerPop's first job would
perhaps be to write AST parsers for the current most popular languages.
Once that is done the java world of TinkerGraph, Neo4j, Cassandra,
Hadoop.... starts.

Following on a previous thread on RDF would Gremlin need a proper
specification of its meta model? As it stands there Gremlin implicit
meta model does not fit exactly with that of RDF. Again I am somewhat
out of my depth but still.

Perhaps even before Gremlin as a query language can be fully specified
its underlying meta model needs to be fully accurately specified in
natural language?

Would this approach open the door the Gremlin becoming a ANSI standard?

Kinda general shooting in the dark ideas but stuff that comes to mind.

Thanks
Pieter

On 13/01/2016 20:47, Marko Rodriguez wrote:
> Hello Pieter,
>
>> Have you started working on this?
> Sorta. In my mind.
>
>> I was wondering if this does not actually warrant a project of its own.
>> Perhaps outside Apache as Apache (as far as I know) is not really in the
>> business of publishing specs. If it has a space of its own somewhere it
>> could be a more collaborative effort.
>> … SNIP
> Lately, in my daydreams, I've been leaning towards "a specification" inspired 
> by the way Kuppitz built sparql-gremlin 
> [https://github.com/dkuppitz/sparql-gremlin] and Wilmes built sql-gremlin 
> [https://github.com/twilmes/sql-gremlin]. At first, I was all hell-bent on 
> being all "virtual machine"-style with an instruction set (opcodes, 
> parameters, and the like). However, after seeing how Kuppitz and Wilmes 
> implemented their respective compilers, I thought it prudent to step out of 
> the 80's and acknowledge that GraphTraversal is THE specification! 
>
> What do I mean by this?
>
> I don't think we should ever publish individual steps as being important. If 
> we do, we will spend all our time trying to make the step library tiny ("only 
> 15 instructions needed man!"). Also, we shouldn't do that cause it leads to 
> optimization issues. For instance, you can implement GroupCountStep using 
> GroupStep, but its not as fast. So, instead of focusing on individual steps, 
> I think we should focus on GraphTraversal as the "machine" the generates your 
> Gremlin traversals. Wilmes and Kuppitz never talk steps in their compilers, 
> they simply create an empty GraphTraversal and then start appending steps 
> (via GraphTraversal.method()) accordingly as defined by the respective 
> high-level language parse. So much easier!
>
> Similarly, this is how I believe DSLs should be created:
>
> public class MyTraversal<S,E> implements Traversal.Admin<S,E> {
>   GraphTraversal rawTraversal = new DefaultGraphTraversal();
>
>   public MyTraversal people() {
>     rawTraversal.hasLabel("person");
>   }
>
>   public MyTraversal knows(String personName) {
>     rawTraversal.out("knows").has("name",personName); 
>   }
>
>   public E next() {
>     return rawTraversal.next();
>   }
>   ...
> }
>
> If DSL designers are thinking of steps and their parameterization, it will 
> really freeze our ability to optimize at the step level. Moreover, we don't 
> want to encourage people to create their own steps as we want our 
> TraversalStrategies to be generally useful regardless of the human-level 
> language. Thus, the mantra should be "all traversals via GraphTraversal."
>
> To your questions about a "language specification." If someone wants to 
> create Gremlin in C++, well, I think they basically copy the GraphTraversal 
> API and implement the respective functionality in various C++ step 
> implementations. Thus, in a way, the GraphTraversal JavaDoc defines the 
> language -- it is the specification (though, we need more semantics defined). 
> I think this is the way to go instead of saying "here are all the 
> instructions/steps in Gremlin with their respective parameterizations."
>
> Thoughts?,
> Marko.
>
> http://markorodriguez.com

Reply via email to