[ 
https://issues.apache.org/jira/browse/TINKERPOP-1232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15207421#comment-15207421
 ] 

Dylan Millikin edited comment on TINKERPOP-1232 at 3/22/16 10:20 PM:
---------------------------------------------------------------------

This is very interesting. 
I'm especially looking forward to point 2). 

For 3) : It might be good to cover some edge cases that need to be worked 
around because of differences in language syntax/semantics. An example that 
comes to mind would be {{has(label, "user")}} which is often either incorrect 
code or expects a {{label}} var/class/etc to be defined. Yet writing it as 
{{has("label", "user")}} can't be converted to string without some work. 
I'm guessing some of these cases can be found for python as well.

Python is a great choice for these examples though. Easiest language to follow 
regardless of your background. 


was (Author: dmill):
This is very interesting. 
I'm especially looking forward to point 2). 

For 3) : It might be good to cover some edge cases that need to be worked 
around because of differences in language syntax/semantics. An example that 
comes to mind would be {{has(label, "user")}} which is often either incorrect 
code or expects a {{label}} var/class/etc to be defined. Yet writing it as 
{{has("label", "user")}} can't be converted to string without some work. 
I'm guessing some of these can be found for python as well.

Python is a great choice for these examples though. Easiest language to follow 
regardless of your background. 

> Write a tutorial demonstrating the 3 ways to write a Gremlin language variant.
> ------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1232
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1232
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: documentation
>    Affects Versions: 3.1.1-incubating
>            Reporter: Marko A. Rodriguez
>
> Talking with [~rustyrazorblade] about collaborating on a Gremlin tutorial for 
> language designers. Here is what we came up with.
> We will use Python as the host language and demonstrate 3 ways to create 
> Gremlin-Python.
> * Using Jython: With Jython you have direct access to the JVM and thus can 
> call {{GraphTraversal}} methods directly. We can expose some Python sugar 
> here and there to show why its good to have a language specific variant. See 
> Gremlin-Scala for inspiration.
> * Using JNI: With Python, we have a {{PythonTraversal}} Python class. That 
> class then uses Java Gateway to interact (via proxy) with {{GraphTraversal}}. 
> This was done in the past as an experiment with R using rJava.
> * Using String: With Python, we have a {{PythonTraversal}} Python class where 
> {{out("knows")}} simply appends {{"out(\"knows\")"}} to a string builder. The 
> result can then be a String sent to a {{RemoteConnection}} for evaluation.
> These three models are the three ways in which any language can embed 
> Gremlin. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to