This experimental feature is just a beginning of system of magics for polyglot programming. See #6477 and #6279.
%%groovy println("stdout works") f = {it + " work"} f("results")
%%groovy new Plot(title:"plots work", initHeight: 200)
%%groovy [a:"tables", b:"work"]
%%groovy "errors work"/1
%%groovy HTML("<h1>HTML works</h1>")