I am just getting my feet wet with gremlin. I understand that gremlin is based on groovy. I found the documentation here, but I am still not sure what the syntax means.
The spaceship operator <=> is an overloaded operator and represents compareTo(). Basically a<=>b is the same as a.compareTo(b)
The example that you gave is using the sort() function with a closure (like lambda in Java8). The syntax for it is the following:
.method{
closureParameters->statements}
So your example is using the sort() function with a closure, inside that closure you use the spaceship (comparator) operator
More about operator overloading here