The 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 seems to be a (terse) language standard. Among other things, it highlights some of the things which are implementation defined, rather than language defined.
It'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.
It'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?
Python 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.
The 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 :-).
> 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.
> 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"?
On 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".
By 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.
I 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.
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.
So, 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?
> 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?
This 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?
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.
That 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.
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.
I 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.
Because the original comment was about the appropriateness of writing Python code according to the reference implementation as opposed to writing Python code strictly according to the reference document. Some people are arguing that the reference documentation is in some sense authoritative and the only resource that should be used to define Python's semantics. In particular the issue at hand is whether the GIL is a part of the semantics of a Python program.
As my position is that the CPython implementation is the reference implementation for Python and as the GIL is an integral part of that implementation, then the GIL does form a part of Python's semantics regardless of whether the reference documentation mentions it or not.
The Python reference documentation is not a specification and it's not intended to be one.
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).
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 to exist or to have a name. What matters is that people use it and get work done with it, and ultimately if looks like a Python and quacks like a Python, then it's fine to call it a Python.
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 implementation and the reference documentation are valid sources that document Python's semantics and that they both can and should be used.
Both of the former provide stronger promises about how likely changes in the future are. For the former, user input and coordination is absolutely required.
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.
> 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.
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.
You're quibbling. By your definition, no programming language has a "specification". Every language has implementations that do things that aren't explicitly described in any document.
Plenty of languages have a specification. C++, Java, C# all do.
Some languages do not, such as Python and Rust.
The ISO C++ committee even uses quite strong language about the C++ standard and makes it a point to differentiate between the C++ specification and C++ references:
>The standard is not intended to teach how to use C++. Rather, it is an international treaty – a formal, legal, and sometimes mind-numbingly detailed technical document intended primarily for people writing C++ compilers and standard library implementations.
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:
Note what the actual C++ standard states, and I quote:
>This document specifies requirements for implementations of the C++ programming language. The first such
requirement is that they implement the language, so this document also defines C++. Other requirements
and relaxations of the first requirement appear at various places within this document
> 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 is in its reference implementation. Why are you now shifting your ground?
> 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 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.
>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.
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":
The C and C++ specifications are rather infamous about being incomplete, i.e., containing features that might lead to undefined behavior. On the other hand, Java is quite comprehensive. It is one of the earliest instances of languages specifying a memory model.
If you don't want to read the whole article, it starts with this summary:
Django, not Flask, is the better choice for beginners' first serious web development projects.
While Flask's simplicity and clear API make it great for learning and suitable for experienced developers, it can mislead beginners about the complexities of web development. Django, with its opinionated nature and sensible defaults, offers a structured approach that helps novices avoid common pitfalls. Its comprehensive, integrated ecosystem is more conducive to growth and productivity for those new to the field.
The modern answer to that are probably books like "the three body problems". Also old French science fiction can be excellent, e.g: anything Barjavel. Not to mention there are always UK outliers, like Douglas Adams.
But personally, I'd say Bande dessinée, the European cousin of comic books, is where you will find the most untapped underrated wonders.
Anything Moebius or Jodoroski, like "L'Incal" or "La caste des Meta-barons" is truly special. The aesthetics have a lot of personality, the writing is messed up, and the world building is all kind of twisted and provoking.
The main problem is that they sometimes take you for a whole run then end up nowhere. But the ride is awesome, and some of it has left scars inside me, I'm not kidding. And it has been translated to English.
Even without aiming for extremes, you'll find all kind of fun stuff.
Like "Aldébaran" that really sells this sense of discovery of new exotic places with a rag tag expedition, like African jungles in the past, but on new planets. It's a big saga too.
"Sillage" that packs your read with a futuristic black window amidst a galactic political turmoil.
Bilal's immortal trilogy giving the Egyptian alien concept some wind.
Or "Le gipsy" for a no brain adventure with a truck driver coasting on a road that wraps around the entire world.
It's crazy to me that given the lack of creativity of Hollywood they scrap everything they can from books and even mangas or video games, but they rarely attack this treasure.
Plus those SF master pieces have equally good fantasy sisters.
A problem with Barjavel - as I remember it - is the stylization of the stories: there is little detail, little background, little world ambiance in these books. Just a one big story. And that makes them paraboles or something - exercises about ONE idea. And not worlds.
In something like L'Incal on the contrary, the world around the story is very rich. In the way the Neuromancer world is rich. There is not JUST the story going on. It goes on in front and in the middle of a richness of OTHER ideas. Which is to me more thought-provoking because less artificial.
I’ve listened to From the Earth to the Moon and Twenty Thousand Leagues Under the Seas, and between the lists of things that mean nothing to me[0] and the humans being unrealistic[1], I have to assume something was lost in the translation, because they… are just not any good.
[0] 10 kinds of seaweed? I think?
[1] I spent my life betting against you and losing! / I challenge you to a duel! — followed by both parties getting distracted before the duel and be found chasing butterflies. Was this a secret code for them pretending to hate each other so they could have a gay affair back when such things were forbidden? Because that would make a lot more sense than the actual words in the audiobook.
Both the language and the day-to-day life has aged and not in a good way. (Shockingly, The Three Musketeers' language and concerns hasn't! It's still great fun. But not scifi.)
I really don't do anything other than work so this is a really nice change - a way to help people/give back a bit - and every time I do one, I learn something new.
They will setup DRM, or render the full site in canvas, or with wasm, or something, or requires a TPM trusted signatured in an approved web browser or some shit.
The new generation will accept a limited client, because they know mostly locked down phones. So only a few will not accept it, and they will not have to care about it a single bit.
They won't. The movie industry has been trying to stop piracy with technical measures forever. Things still get pirated. Every measure they take will be broken.
They'll win over the masses, which is what they really care about. But they won't ever defeat the die-hards.
Previously Google was not a monopoly in so many areas. Now the Internet goes through Google. It caters to investors, not to users. It controls search engine, and a browser, and phones. It can decide what is happening on client side, and on search server side.
The wild west of the Internet has ended. We have the corporate Internet now, that is surveilled and scanned, and they became quite efficient with that.
Previously you could find pirate links through Google, this has ended. You could run pirate software, but software more and more ask OS for approval to be executed. Android will scan sideloaded apps for example.
While environment becomes safer, it also becomes more controlled by corporations. Piracy eventually will be very hard to do. All blockades can be broken, but there more and more of them.
The die-hards aren't really doing it for any practical purpose, they're just doing it to show it can be done. Mainstream media have been ignoring. them for decades now and continue to make boatloads of money.
Depends on how highly you value your privacy. Ads aren't just annoying visually, they contain little tracker bits spying on you.
Long before I had an adblocker, I developed "banner blindness", the real benefit my adblocker gives me is less info leaking out to the platforms. (and since ublock/umatrix is so great, also more security and better loading times, but these are cherries)
If that counts as a "practical purpose" is up to you.
By providing a better service. Not by combatting the pirates in a technological arms race. Incidentally, movie/TV piracy is on the rise again as streaming has become more fragmented and more expensive.
Netflix with account sharing has perhaps killed Torrents, which to me doesn't seem that different. People I know went from free torrents to free Netflix (or a "ok I'll pay your beer for letting me use your Netflix"). Now account sharing is out, Torrents will increase again.
Torrents never left. I've had no issue over the last 15 years with either torrents or newsgroups, everything's just as accessible and quickly released as it was then.
Netflix had the chance to become the Steam of Movies, effectively killing piracy in the field, however between every company creating their own streaming service and hiking prices, my (admittedly anecdotal) impression is that some people are going back to pirating at least some of the time.
There is like a decade between Napster ending and Spotify launching. No, it's iTunes that killed mp3 pirating, Spotify killed what was left of it plus optical media.
Netflix may have dampened torrents at some point, but boy are those making a comeback with the splintered enshittifcation prone streaming world we live in.
They will setup DRM, or render the full site in canvas, or with wasm, or something, or requires a TPM trusted signatured in an approved web browser or some shit.
That was going to be WEI [1] but they shelved it for now. I expect they will be more subtle with the next project release after it gets renamed.