Make compiler fully compatible with py3 while retaining py2 support#34
Make compiler fully compatible with py3 while retaining py2 support#34gorel wants to merge 5 commits into
Conversation
|
Something to call out: In python3, there is no I'm not sure if this actually has implications (if there's something that depends on int being fixed-size), but if so, we'll need to find an alternative. Int in python3 is arbitrary-precision, so this was my solution to get the code to continue working. long is not a type in python3. |
|
As explained on the mailing list the MAMBA python language is going to be phased out over the coming year. The next release will remove half of the python reliance already. Also this has resulted in a number of changes in our back end which I would need to integrate with your changes. Thus we are probably not going to integrate this. Please email us if you are going to make big changes and keep in contact, as we have a quite a lot of changes in our private branch which we only push on a quarterly basis to the public repo. |
The Compiler/ directory was only compatible with Python2. This is a big issue since py2 support officially ended on January 1, 2020. In the interest of causing the least amount of friction, I retained py2 support in this diff, but my primary goal was to get the compiler to run in py3.
Here's the process I went through to add py3 support:
longtype hack, unicode/bytes, remove relative imports)I may have missed some minor differences with int vs long still, so I'll audit my own changes again.
For testing, I simply ran
python2 compile.py Programs/test_all/andpython3 compile.py Programs/test_all/. I'm not sure if there's a more rigorous way to test, but these both work with my changes.Very open to any feedback you may have. I realize these changes may not be the prettiest, but my goal was functionality while touching as few lines of code as possible instead of making it look good.