Port main.Main to Groovy.