Earlier quoted context omitted.
> Python doesn't have a standards document. It has a reference implementation that defines the language. That's not quite strictly true, Python does have a documented "Language Reference": https://docs.python.org/3/reference/index.html If there is a contradiction between the Language Reference and CPython then one, or both, of them needs to be updated and it's treated on a case by case basis. If an alternative Python…
And what about PEPs, which describe (in pretty good detail) what changes will be made?
The Changing "Guarantees" Given by Python's Global Interpreter Lock
131–140 of 142 posts
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#132Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#133Earlier quoted context omitted.
Whether it is a specification or a reference doesn't really matter for this discussion. What matters is that it is the closest thing to a specification that exists for Python. Assuming anything beyond it ties the program to internals of a specific implementation. Internals for which the vendor might have different intentions about keeping stable or change than users expect.
It's absolutely pertinent to this discussion, this whole discussion is about whether the GIL is part of the semantics of a Python program or not. My position is that it is because the GIL is a part of the CPython reference implementation. Others object saying that the Python reference document is what specifies its semantics, not the reference implementation. My position is that both the CPython reference implementat…
Implementation details are documented to allow performance optimizations and to give insight into why certain things are how they are. Therefore, users can reasonably expect that the vendor won't cause performance regressions for existing code. However, it is unwise to derive semantics from them, even if they are technically documented in that way.
One of the biggest disadvantages of relying on implementation details is that it makes it way more troublesome for the vendor to maintain and improve the product.
Anyways, the GIL and the presence of possible concurrency bugs are completely orthogonal things as the GIL has always only served to prevent corruption of runtime data structures, not of user code.
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#134Earlier quoted context omitted.
Whether it is a specification or a reference doesn't really matter for this discussion. What matters is that it is the closest thing to a specification that exists for Python. Assuming anything beyond it ties the program to internals of a specific implementation. Internals for which the vendor might have different intentions about keeping stable or change than users expect.
It's absolutely pertinent to this discussion, this whole discussion is about whether the GIL is part of the semantics of a Python program or not. My position is that it is because the GIL is a part of the CPython reference implementation. Others object saying that the Python reference document is what specifies its semantics, not the reference implementation. My position is that both the CPython reference implementat…
And my position is that it is not because there are other implementations of Python that do not have it, and which everybody agrees are implementations of Python.
Not only that, but the very language reference that I linked to explicitly distinguishes CPython implementation details from the language itself. So the Python dev team does not appear to agree with your position.
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#135Earlier quoted context omitted.
Then why are different implementations of Python all implementations of Python? What makes them implementations of Python rather than different languages? I've already given my answer: they all meet the language reference I linked to (yes, the word "reference" appears in its title, not "specification"; that's just another quibble). What is your answer?
Haha, no they don't all meet the language reference you linked to and if you used them you'd know that! Python is a lot more like LISP than it is C++. There are many flavors of Python, from MicroPython to GraalPython to Cyston and literally dozens of them. They most certainly do not all meet the language reference you linked to and they all have quirks here and there. A language does not need a specification in order…
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#136Earlier quoted context omitted.
Does every C++ implementation do exactly what is in the C++ language specification, no more, no less? Same question for Java and C#. If the answer to all of these questions is "no", as I believe it is, on what grounds do you claim that these languages have a specification, while Python and Rust do not?
Yes the C++ and Java implementations do exactly what is in the language specification. The C++ specification explicitly allows languages to do more, but it can not do less. I believe Java has a similar clause but I'm not sure. The grounds that I claim is that you can read them, here they are: https://docs.oracle.com/javase/specs/ https://isocpp.org/files/papers/N4860.pdf Note what the actual C++ standard states, and…
The number of Google hits I get when I search on "C++ implementations that do not meet the language specification" does not seem to support this claim.
> Note what the actual C++ standard states
But your position with respect to Python is that it doesn't matter what the "standard" states because the actual definition of the language is in its reference implementation. Why are you now shifting your ground?
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#137Earlier quoted context omitted.
Yes the C++ and Java implementations do exactly what is in the language specification. The C++ specification explicitly allows languages to do more, but it can not do less. I believe Java has a similar clause but I'm not sure. The grounds that I claim is that you can read them, here they are: https://docs.oracle.com/javase/specs/ https://isocpp.org/files/papers/N4860.pdf Note what the actual C++ standard states, and…
> the C++ and Java implementations do exactly what is in the language specification The number of Google hits I get when I search on "C++ implementations that do not meet the language specification" does not seem to support this claim. > Note what the actual C++ standard states But your position with respect to Python is that it doesn't matter what the "standard" states because the actual definition of the language i…
That is an incredibly weak and ill-informed method for vetting technical matters.
>Why are you now shifting your ground?
Python doesn't have a standard.
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#138Earlier quoted context omitted.
> the C++ and Java implementations do exactly what is in the language specification The number of Google hits I get when I search on "C++ implementations that do not meet the language specification" does not seem to support this claim. > Note what the actual C++ standard states But your position with respect to Python is that it doesn't matter what the "standard" states because the actual definition of the language i…
>The number of Google hits I get when I search on That is an incredibly weak and ill-informed method for vetting technical matters. >Why are you now shifting your ground? Python doesn't have a standard.
So is your claim that, because a "standard" says something and claims it's a "specification", that is sufficient to guarantee that every implementation does exactly what the "standard" or "specification" says.
> Python doesn't have a standard
Again, you're quibbling. It has a language reference, which I linked to, and which is what is used to determine what implementations count as Python implementations.
At this point I don't think we have enough common ground for a useful discussion.
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#139Earlier quoted context omitted.
>The number of Google hits I get when I search on That is an incredibly weak and ill-informed method for vetting technical matters. >Why are you now shifting your ground? Python doesn't have a standard.
> That is an incredibly weak and ill-informed method for vetting technical matters. So is your claim that, because a "standard" says something and claims it's a "specification", that is sufficient to guarantee that every implementation does exactly what the "standard" or "specification" says. > Python doesn't have a standard Again, you're quibbling. It has a language reference, which I linked to, and which is what is…
It's the other way around, a standard specifies the requirements of a conforming implementation, and then an implementation can claim conformance with respect to that standard. With C++, many well-known implementations do claim conformance to the standard such as MSVC, GCC and Clang. With Python no one makes such a claim, not even the CPython reference implementation, because there is no standard to conform to. On the contrary what you do find are implementations that try to be compatible with CPython reference implementation specifically, such as PyPy and Pyston but no one claims to conform to the Python reference manual. The reference document simply describes how some Python implementations happen to work, but it does not prescribe how a Python implementation is required to work in order to be in compliance.
If tomorrow CPython decides to add a new feature to the language, then the reference will be updated to include this change because the reference is a reflection of the implementation.
If tomorrow the C++ specification changes, then it's GCC or any compiler that claims conformance that will update to include that change because with C++ it's the implementation that is a reflection of the specification.
That's the key difference between a descriptive document and a prescriptive document. This may seem like a quibble as you put it, but quibbles can lead to multimillion dollar lawsuits as Microsoft learned in the 90s when they claimed to have an implementation of the Java specification and then were sued by Sun Microsystems because Microsoft's implementation did not in fact conform to the Java standard.
Microsoft ended up paying 20 million dollars over this so called "quibble":
https://en.wikipedia.org/wiki/Microsoft_Java_Virtual_Machine...
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#140Earlier quoted context omitted.
Or I could just accept that neither numeric, nor string ordering works for semantic versioning, and write a trivially easy piece of code that does the ordering in a contect where I expect such a scheme. > If we wanted trivially comparable with regular numeric ordering we could have incremental numbers as versions. 1, 2, 3, ... Yes, and then we would be back to the day when the version number gave me zero information…
> Or I could just accept that neither numeric, nor string ordering works for semantic versioning, and write a trivially easy piece of code that does the ordering in a contect where I expect such a scheme. Hence the whole "3.10 and 3.9 are perfectly mechanically comparable (meaning one can write a program to deterministically compare them and return their relative order)" part in my comment you perhaps missed. > Yes,…
I didn't miss any part of your comment. The line you quote was as a reaction to the alternatives presented immediately after that part.
Because why would I sacrifice the advantages of semver for a minor convenience to the programmer of a sorting function?
> in practice the semver works 95% of the time
Which, based on nothing but my gut feeling, is a lot better than the 30% of the time any other versioning scheme works, where the only way to be reasonably sure that an update would not break my code was to diff the library (if the thing is open source), or read all the documentation, and pray to Zeus that it's complete and accurate.