GoogleによってPythonコードをGoに変換するGrumpyが公開されました。 Google Open Source Blog: Grumpy: Go running Python! google/grumpy: Grumpy is a Python to Go source code transcompiler and runtime. Pythonには標準でastモジュールがあり、構文解析結果に直接触ることが可能です。 import ast node = ast.parse(''' def main() -> int: print("Hello World!") return 0 ''') print(ast.dump(node)) # Module(body=[FunctionDef(name='main', args=arguments(args=[], vararg=Non