This is the excerpt from the project's Github page.

Gremlin provides graph traversal related syntactic sugar to Groovy. Groovy provides dynamic language syntactic sugar to Java. Realize that anything you can do in Java or Groovy can be done in Gremlin.

The documentation keeps referring to Groovy & Java.

I need to learn it but I am not a member of Java family -- and will likely never be. Can I still learn Gremlin?

Can someone point me to some docs/articles that explain Gremlin without assuming Groovy or Java acquaintance?


The key here is Groovy, check out its Wikipedia entry.

Very Basically, you could say that Groovy is "on top" of Java and that Gremlin is on top of Groovy.

While using Groovy you have access to a new more compact syntax (but it really is not the only feature) and also to the full power of Java since you can use any Java library available. The most interesting feature though, and what really is important in the context of Gremlin is that Groovy is a scripting language for Java. You write Groovy/Java code as if you were using some shell script and the code you write is dynamically compiled and executed on the JVM.

Now, what the developers of Gremlin have done is "extend" the syntax of Groovy with some graph traversal related syntax (as well as provide a graph traversal API of course). They do not forbid you to use Gremlin from Java. You may still use Gremlin in a "standard" Java application, but as the example shows it, it is not its primary intended usage.

To resume, in order to use Gremlin (from the minimum requirement to the most optimal requirement):

  1. You have to know Groovy or Java (or you will need to :-)
  2. If you are a long-time pure Java programmer you have the advantage of knowing parts of the JDK, and many other existing libraries or frameworks such as Apache Commons, or Spring for example (Spring supports Groovy!). You don't know the more compact Groovy syntax, but you will be alright.
  3. If you know Groovy...you most probably know Java :-) but not necessarily. You will do alright.
  4. If you both know Java and Groovy, you are God. No, not really. But you will have no trouble at all.

Note that for points 2-3-4 you will of course need to go through Gremlin's documentation.

  • So, does that mean I have no chance with Gremlin? Since I don't know Java & Groovy. – treecoder Sep 29 '11 at 6:28
  • Why "no chance" ? You can do it, you just have a steeper learning curve. If you want to quickly dive into Gremlin, I suggest you to forget Java for now and to dabble with Groovy, for example, start with the "Getting Started" tutorial: groovy.codehaus.org/Getting+Started+Guide. I keep repeating what someone said to me once "it is made by humans, for humans", so you can do it :-) Once you feel you are able to write some basic applications, try Gremlin's tutorials at youtube.com/watch?v=5wpTtEBK4-E and windycitydb.org/videos2011/#1. Don't be discouraged, you can do it. – Jalayn Sep 29 '11 at 6:35
  • Ok so if I learn Groovy considerably in-depth, and don't ever touch Java -- would that be enough for Gremlin. I mean do I HAVE to know Java for doing everything Gremlin offers -- or knowing Groovy is sufficient. – treecoder Sep 29 '11 at 6:38
  • I think you will be fine with Groovy. I looked up Groovy's tutorial and you will quickly encounter commonly used Java classes such as Lists and Maps, but it's very nicely explained, so you should be OK. Give it a try anyway, you will only be sure by starting practicing. – Jalayn Sep 29 '11 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.