Hacker News new | ask | show | jobs
by VWWHFSfQ 1070 days ago
I'm not sure what "codemods" means. Just static analysis code changer? Python is so highly runtime dynamic I'm not sure a tool is even possible to upgrade behavior, preserving correctness and intent (bugs and all).
2 comments

Not the poster of the question,

But I think they're referencing the litany of transpilers and repackagers which exist for js. So you can add new features and then still have it run on really old systems like internet explorer 9 if you need to.

This has problems obviously and in my opinion for python it would be preferable.

My reasoning being that if you need your code to work on an older system being able to write and use current syntax is preferable to not, and the hard bifurcation that python did with 2 to 3 and now potentially with 3 to nogil seems to me just to break apart the ecosystem more.

That differs but is a reasonable understanding. I’m instead referring to automations that perform large scale refactoring as handled by Facebook, who would be contributing to this effort.

https://github.com/facebookarchive/codemod

It sounds like what you are describing is what’s known as poly fills which convert code into a variant that maximizes function across implementations which isn’t really applicable here.

https://github.com/facebookarchive/codemod

Ironically this is also from Meta which would be contributing to this space increasing the expertise of achieving this result.

what on earth is this thing. Just a regex replacer called "codemod"? This does nothing.