A 2D Gremlin Language Variant

90 views
Skip to first unread message

Marko Rodriguez

unread,
Oct 19, 2016, 10:05:07 AM10/19/16
to gremli...@googlegroups.com, d...@tinkerpop.apache.org
Hello,

Last night I was cruisin’ around Wikipedia and was checking out various programming languages. One in particular caught my eye — APL.


I thought it would be neat to have different type of syntax to express Gremlin traversals and came up with the following "2D pipes” language.


Basically, there are “piping” symbols that dictate traverser flow:
- ^ / \ 
These pipes link the steps, where commonly used steps have a short-hand syntax.

The translator to go from this to Gremlin bytecode seems pretty simple. The internal data structure for the language is:

List<List<String>>

This give you the 2D matrix. You then can go “up and down” the lists and “left and right” along the tokens, where the - ^ \ / pipes tell you how to move about the List<List<String>> structure.

Does anyone think this is cool?

Marko.

Robert Dale

unread,
Oct 19, 2016, 7:08:18 PM10/19/16
to gremli...@googlegroups.com, d...@tinkerpop.apache.org
Reminds me of brainfuck.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/B347B223-FD64-4F5C-9E65-7F50CF72BF38%40gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Dale

HadoopMarc

unread,
Oct 20, 2016, 10:19:16 AM10/20/16
to Gremlin-users, d...@tinkerpop.apache.org
Hi Marko,

APL was especially cool for punchcards or VT100 terminals ...

I'm always in for more efficient notations for graph analytics. Maybe tensor notation can also provide some inspiration for 2D operations:


Cheers,     Marc

Op donderdag 20 oktober 2016 01:08:18 UTC+2 schreef Robert Dale:
Reminds me of brainfuck.

On Wed, Oct 19, 2016 at 10:04 AM, Marko Rodriguez <okram...@gmail.com> wrote:
Hello,

Last night I was cruisin’ around Wikipedia and was checking out various programming languages. One in particular caught my eye — APL.


I thought it would be neat to have different type of syntax to express Gremlin traversals and came up with the following "2D pipes” language.


Basically, there are “piping” symbols that dictate traverser flow:
- ^ / \ 
These pipes link the steps, where commonly used steps have a short-hand syntax.

The translator to go from this to Gremlin bytecode seems pretty simple. The internal data structure for the language is:

List<List<String>>

This give you the 2D matrix. You then can go “up and down” the lists and “left and right” along the tokens, where the - ^ \ / pipes tell you how to move about the List<List<String>> structure.

Does anyone think this is cool?

Marko.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.



--
Robert Dale

Marko Rodriguez

unread,
Nov 9, 2016, 8:52:23 PM11/9/16
to gremli...@googlegroups.com, d...@tinkerpop.apache.org

Marko Rodriguez

unread,
Nov 9, 2016, 9:24:01 PM11/9/16
to gremli...@googlegroups.com, d...@tinkerpop.apache.org
Hi,

I was thinking about your tensor notation desire.

[created]x[knows]^ 

is equivalent to:

V().out(‘created’).in(‘knows’)

In general, we could do stuff like in this article:


We just map all the presented algebraic operations over to a syntax that can then be compiled to Gremlin bytecode.

Marko.
Reply all
Reply to author
Forward
0 new messages