Open XVilka opened 4 years ago
This is interesting, but what exactly is your issue/concern/proposal?
@alanjds Idea is to convert the current Python codebase to Go, with a similar workflow as c2rust - first, transpile, this is what grumpy already does, but extend the tool with refactoring capabilities of the produced code, to help the porters to keep project running and passing tests while the slow porting is progressing.
Well, you can already do that.
Passing grumpy -v debug --keep-main script.py
, all the transpiled code will be kept and the Go compiler command will also be echoed. You can collect this and start rewriting your Py modules to Go and replacing it via from '__go__/mymodule' import Myfunc
The main() is wrote to a location on /tmp that is kept when --keep-main
flag is set. There you can follow the execution line.
A good example on how this can be done is c2rust. It not only converts the source, but keeps it compilable, provides the refactoring tool and means to script the refactoring with Lua language. See their manual for more information.