4 ms·
Python does have a machine readable grammar. The reason Jython isn't at 2.6 is not because of syntax changes, those would probably take less than a day to do,
by kingkilr 17y ago
Python does have a machine readable grammar. The reason Jython isn't at 2.6 is not because of syntax changes, those would probably take less than a day to do, it's all the semantic changes that take time.
- andreyf 17y agoYou're right, I should have addressed that: there's more to syntax than grammar. All of the semantic changes I can think of in Python could easily be implemented as syntax transformations in a way portable across implementations. Decorators, the with statement, print-as-a-function, etc... There might be some I'm missing that would be non-trivial as macros, but I'd benefit significantly just from having the ones that are plain syntax sugar without having to convince my team to use a py3-to-2 compiler.
- kingkilr 17y agoI suggest you take a look at the 2.6 release notes (http://docs.python.org/whatsnew/2.6.html http://docs.python.org/whatsnew/2.6.html), the number of items on here that constitute simple syntax transformations is dwarfed by the number that require active work in the VM.
- andreyf 17y agoAbsolutely, that would requre a ton of work to upgrade. Looking through that page is precisely what convinced me the moratorium is a practical thing for the language. But most changes there aren't semantic, either. I'm talking about changes to the language, not the implementation, changes like the "with" statement, like new packages, not changes like how site-packages works. Maybe my point was a little on the subtle side: being able to implement changes to a language's syntax and semantics without doing it again for each and every implementation is a better solution to one problem the moratorium is solving.