Live data from Hacker News

Python's Original Sin

andreyf.tumblr.com

31–40 of 55 posts

Re: Python's Original Sin

#31
post #21

Earlier quoted context omitted.

You'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…

I suggest you take a look at the 2.6 release notes ( 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.

Absolutely, 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.

Re: Python's Original Sin

#32

Earlier quoted context omitted.

He's likely arguing against any non-Functional Language. "Purely functional" Lisp has no statements, side-effects, etc, for instance.

No, he's probably arguing in favor of expressions (i.e. stuff that returns values). Smalltalk has expressions everywhere, with control blocks being just closures passed to methods on objects ... a > "Purely functional" Lisp has no statements, side-effects, etc, for instance. Such a Lisp also has no users.

And no implementations.

Re: Python's Original Sin

#33
"band-aids like the moratorium become necessary solutions, alleviating the symptoms of a more fundamental design flaw: syntax and semantics which require human implementation instead being portable from one implementation to another."

Would it be easier to for alternative implementations (non-CPython ala Jython, IronPython, etc) to keep up if the syntax was portable between them? Yes, of course. Is this a "Design Flaw"? Not in any way.

Portable syntax between implementations is not a primary goal of Python (the language) so I don't see any merits for criticizing it for not taking a feature never previously desired (most of the alternative runtimes are relatively young) into account in the underlying design.

If you need to alter/extend the syntax to python at some point I'd advising looking at the python magazine article on implementing DSL's w/pyparsing noted here: http://pyparsing.wikispaces.com/Publications

If are in frequent need to alter/extend the syntax of the language you are using, and it is a non-trivial task, then you are using the wrong language.

Re: Python's Original Sin

#34
I don't think it's very credible to hold Perl 6 up as the standard for how to encourage and enable complete implementations, considering that ten years in, it still has only partial implementations.

Re: Python's Original Sin

#35
post #10

This is interesting, but I don't know that reality matches the author's theory. After all perl 6 is hardly a shining example of how a language should be upgraded. It's been in the works for at least a decade. Say what you will about python 3, but at least it exists and has been released.

> Say what you will about python 3, but at least it exists and has been released. Yeah, and nobody is upgrading because it doesn't give you much incentive unless you enjoy breaking backwards compatibility. It has also been in development for at least 5 years. I don't get why people get version numbers so literally. Perl6 is a new language inspired by Perl5. Python 3 is just a minor enhancement that happens to break b…

Yea Perl 6 is a new language, but Perl 1-5 were the same language just like Python 1-3 are. What should have been Perl 6 or even 7 just got released as Perl 5.12. Perl 5 isn't going anywhere, I can imagine in 10 years we'll be seeing Perl 5.27. It doesn't really make sense, if they wanted to write a new language but they wanted to use the Perl moniker for marketing purposes they should have called it Perl++

Re: Python's Original Sin

#36
post #32

Earlier quoted context omitted.

No, he's probably arguing in favor of expressions (i.e. stuff that returns values). Smalltalk has expressions everywhere, with control blocks being just closures passed to methods on objects ... a > "Purely functional" Lisp has no statements, side-effects, etc, for instance. Such a Lisp also has no users.

And no implementations.

Incorrect: ACL2, an industry-standard automated theorem-prover, is written in a side-effect-free variant of Common Lisp. It has both an implementation and users, including users outside of academia.

http://en.wikipedia.org/wiki/ACL2

Re: Python's Original Sin

#37
post #34

I don't think it's very credible to hold Perl 6 up as the standard for how to encourage and enable complete implementations, considering that ten years in, it still has only partial implementations.

I would also put C and C++ in that box then.

Re: Python's Original Sin

#38

I'm not sure I buy this argument. The author seems to be arguing that it's a fatal design flaw for a language not to be implemented in itself. But as near as I can tell not that many languages are implemented in themselves. I'm pretty sure Java and C# (as examples) are implemented in C. Also, his argument that the compatibility issues between JPython and CPython are because python isn't implemented in itself also don…

> I'm pretty sure Java and C# (as examples) are implemented in C.

Not to argue against your point (you don't need self-hosting to get cross-implementation compatibility), Jikes RVM http://jikesrvm.org/ > is a JVM written in Java itself.

Re: Python's Original Sin

#39
post #36
post #32

Earlier quoted context omitted.

And no implementations.

Incorrect: ACL2, an industry-standard automated theorem-prover, is written in a side-effect-free variant of Common Lisp. It has both an implementation and users, including users outside of academia. http://en.wikipedia.org/wiki/ACL2

I guess both (no implementations, no users) were meant in relative terms, and in that light they describe reality pretty well.

Hands up, who has heard of ACL2 before?

Re: Python's Original Sin

#40
post #4

I'm not sure I buy this argument. The author seems to be arguing that it's a fatal design flaw for a language not to be implemented in itself. But as near as I can tell not that many languages are implemented in themselves. I'm pretty sure Java and C# (as examples) are implemented in C. Also, his argument that the compatibility issues between JPython and CPython are because python isn't implemented in itself also don…

the compatibility issues between JPython and CPython are because python isn't implemented in itself Didn't say that. Said that self-hosting is one solution (one Perl 6 uses), not the only one. [Ruby's secret] isn't self hosting, but rather a very comprehensive unit testing suite for the language No, Python also has a comprehensive test suite. The difference between Jython and Ruby is that Jython isn't as well maintai…

Ahh.. Thanks for the clarification. That makes a lot more sense to me now. I thought you were arguing a slightly different point. :-)
Post reply on HN