Hi all, Lambdas are not supported in Grammar because they themselves are an entire language, based on Groovy syntax. Current implementation in Gremlin Server allows Lambdas arbitrary code execution with access to the entire JVM, which is not optimizable by providers. Also this leads to security problems that, despite numerous attempts to secure the Groovy sandbox, have not been successful.
Since we decided gremlin-language will be the default in Gremlin Server, the choice to remove Lambda syntax for non-JVM languages and in scripts sent over HTTP makes sense because this will allow us to have the same capabilities for different script engines and increase security of Gremlin Server. Existing scripts that use Lambdas anyway wont work in TinkerPop 4 because default will be gremlin-language. Lambdas can remain for embedded use cases as a form of added/sugar syntax for steps where they have made sense since their inception. Happy to hear any thoughts on the matter. Regards, Valentyn