Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild tool for automated refactoring #143

Open
XVilka opened this issue Oct 17, 2019 · 3 comments
Open

Rebuild tool for automated refactoring #143

XVilka opened this issue Oct 17, 2019 · 3 comments

Comments

@XVilka
Copy link

XVilka commented Oct 17, 2019

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.

image

@grumpyhome grumpyhome deleted a comment Dec 26, 2019
@alanjds
Copy link

alanjds commented Dec 26, 2019

This is interesting, but what exactly is your issue/concern/proposal?

@XVilka
Copy link
Author

XVilka commented Dec 26, 2019

@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.

@alanjds
Copy link

alanjds commented Dec 26, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants