Use of python 2.7 #108
Replies: 2 comments 1 reply
-
This is due to oil which requires python2. https://github.com/abathur/resholve#:~:text=resholve%20uses%20python2 |
Beta Was this translation helpful? Give feedback.
-
Thanks for reaching out :) Sandro has it right, but I can elaborate a bit. It isn't a decision I took lightly, but I believe the Oil shell project's OSH parser is the best foundation for resholve's work. The OSH parser drives a working shell that is very close to completely compatible with bash. The OSH shell's ability (and ongoing aspiration) to run nearly any bash script ~proves that the parser is robust enough to support tricky tasks like rewriting shell source without breaking things. OSH also tries to handle as much bash ~statically as possible. This gives resholve some helpful levers for determining whether parts of the parse tree are static (roughly, safe to reason about without evaluating them), and having it attached to a working shell also means that resholve can technically do some light eval, as long as we're careful, to broaden the set of scripts it can handle. Oil's written in python2 for its own reasons. If you're curious, you can read about those reasons at https://www.oilshell.org/blog/2018/03/04.html#faq. (I entertained trying to build resholve on a python3 port of oil to mitigate this concern, but that'd leave me to maintain a bespoke fork of a fast-moving alpha codebase that is several times larger than resholve. That almost certainly would have ruled out keeping up with parser fixes in the oil codebase.) I don't think this will be a permanent condition. As the C++ implementation of oil (it's a lot to explain, but this isn't a one-time translation--they'll still be developing it in python2) matures, I think it'll end up with some form of interchange format for its parse trees. That should free resholve to move to python3 (or some other language, down the road). That said, it'll probably be a good bit of work, and it might mean giving up some of the interesting levers resholve gets from being implemented on top of a working shell and not just its parser. |
Beta Was this translation helpful? Give feedback.
-
Hi,☺️
I recently became interested in the project and found it really helpful. 🎉 When looking in the source code I saw that the project uses python 2.7 and not 3.x as you would usually expect today. Is there a specific reason for using the deprecated version and not a more recent one?
Beta Was this translation helpful? Give feedback.
All reactions