7 ms·
The gil is a feature. Not using a feature that makes sense in our context is counter productive.
by BiteCode_dev 3y ago
The gil is a feature. Not using a feature that makes sense in our context is counter productive.
- nicolaslem 3y agoThe GIL in an implementation detail of CPython, it's not part of Python the language.
- colanderman 3y agoIt's been a while since I've followed Python closely but last I heard Python-the-language is de facto defined as "whatever CPython does". Has Python since grown a proper language specification?
- formerly_proven 3y agoNo.
- dragonwriter 3y agoPython doesn't have a full specification, but it does have first party documentation that distinguishes between CPython implementation details and language guarantees, in part to support alternative implementations.
- pdonis 3y ago> Python doesn't have a full specification This doesn't count? https://docs.python.org/3/reference/index.html https://docs.python.org/3/reference/index.html
- squeaky-clean 3y agoThe introduction section states that it's not a complete/exact specification. If you're using a Python implementation and have a question, this should answer it. If you're writing a Python implementation and have a question, this may not answer it. > Consequently, if you were coming from Mars and tried to re-implement Python from this document alone, you might have to guess things and in fact you would probably end up implementing quite a different language. On the other hand, if you are using Python and wonder what the precise rules about a particular area of the language are, you should definitely be able to find them here. If you would like to see a more formal definition of the language, maybe you could volunteer your time — or invent a cloning machine :-).
- pdonis 3y ago> If you're writing a Python implementation and have a question, this may not answer it. Depends on the question. If your question is, say, "how should I implement the built-in types", yes, the language reference won't answer that question. But if your question is "what does my implementation have to do to count as an implementation of the Python language", then yes, the language reference does answer that question--since the language reference is what defines the Python language. To me that is a "specification" of the Python language. It's not a specification of the implementation of the language, but why should that be required for something to be considered a language specification? The whole point is to specify what is required to define the language without specifying every detail of the implementation.
- pdonis 3y ago> if you were coming from Mars and tried to re-implement Python from this document alone, you might have to guess things and in fact you would probably end up implementing quite a different language Yes, I know that statement is in the Introduction, but I think it's rather ill-considered. If my implementation is consistent with the language reference, on what grounds would someone claim it was not an implementation of Python but a "different language"?
- uxp8u61q 3y agoOn the grounds that we live in the real world, not a world where anything written down is a true and complete description of reality. "Technically correct" is sometimes a synonym of "incorrect".
- pdonis 3y agoBy your criterion, no programming language has a language specification at all. I don't think that's a useful way to look at things. I would like to see some indication from the people who say that the Python Language Reference I gave a link to does not qualify as "language specification", of what would qualify. Specific examples would be nice.
- dragonwriter 3y agoI would say that that is intended as documentation for users (includong implementors of tools targeting the language), not a specification for implementors of Python, but I would agree that it is largely usable in either role; my point in the GP was that something distinct called “the Python Language Specification” doesn't exist, but that a (not necessarily complete, from a language implementors perspective) specification distinct from the implementation behavior of CPython does effectively exist in the documentation.
- pdonis 3y ago> not a specification for implementors of Python I don't see why not. The "Introduction" section specifically mentions different implementations and distinguishes implementation details, which can vary by implementation, from the language reference itself, which defines what every implementation has to meet to be considered an implementation of the Python language. > my point in the GP was that something distinct called “the Python Language Specification” doesn't exist And that's the point I'm disputing; AFAIK the language reference I linked to is that something distinct, even if it isn't called a "Language Specification" but instead a "Language Reference". Either way it defines what the Python language is.
- dragonwriter 3y agoSo, we rather explicitly agree that Python has nothing called a “language specification”, but that its published first party documentation includes what is, functionally, a specification of the language distinct from CPython implementation details? Not sure why there is an argument here.
- BerislavLopac 3y agoThis implies that, if CPython differs from that specification in any way, it is not, in fact, Python. What have I been using all these years, I wonder?
- pdonis 3y ago> we rather explicitly agree that Python has nothing called a “language specification” No, we don't. I have already said explicitly that I think the Python Language Reference is such a thing. (I am ignoring quibbles about it being called a "reference" instead of a "specification".) If you think it isn't, why? What does count as a "language specification" in your view? Do you have any specific examples that you can contrast with Python?
- friendzis 3y agoAFAIK, there is no Python language specification, therefore implementation details of CPython IMO is the language.
- pdonis 3y ago> AFAIK, there is no Python language specification Yes, there is: https://docs.python.org/3/reference/index.html https://docs.python.org/3/reference/index.html This specification does not mention the GIL anywhere, which means it is, as the GP said, an implementation detail. Other implementations of Python that do not have the GIL are still "Python" implementations because they meet this language specification.
- Kranar 3y agoThat is not a specification. A specification is a prescriptive document of how a system is required to work whereas a reference is a descriptive document of how a system happens to currently work. Python has a reference, in fact it has many references that even contradict one another in subtle ways, but it does not have a specification.
- eesmith 3y agoWhat advantages would there be to that document? I mean, I can see the point if there are multiple commercial competitors in the market, as there is with C/C++, or if the implementation is proprietary and the users want to avoid vendor lock-in. But the Minimal BASIC of ANSI X3.60-1978 never did catch on for any of the BASICs I used in the 1990s, and the Full BASIC of ANSI X3.113-1987 was a flop, so clearly it's possible to put a lot of time into a standard only to have it be irrelevant.
- Kranar 3y agoI never mentioned any advantage or disadvantage. I am only stating a fact about the current state of Python. Python does not have a specification or a standards document, it has a reference that describes how Python happens to work and the reference is a great resource for people to familiarize themselves with the language but it should simply be clear that its purpose is to reflect the existing state of the language rather than to specify how Python works.
- nerdponx 3y agoThere is no language standard. The GIL is a Python language feature because it's a CPython feature.
- eesmith 3y agoThe GIL is not a required language feature. Neither Jython nor IronPython have a GIL. What would it mean to have a language standard? A publication from ISO or ECMA? I ask because the Python Language Reference at https://docs.python.org/3/reference/index.html https://docs.python.org/3/reference/index.html seems to be a (terse) language standard. Among other things, it highlights some of the things which are implementation defined, rather than language defined.
- nerdponx 3y agoIt's not a required language feature, but it's most certainly a feature of CPython, and CPython is still effectively synonymous with Python, even if other implementations deviate in various ways from its behavior.
- deleted 3y ago[deleted]
- BiteCode_dev 3y agoBoth can be true, espacially since the implementation has been the same for 20 years.
- usrbinbash 3y agoNo it isn't. It's an implementation detail, and relying on those for functionality is a great way of getting ones code to break.