7 ms·
Python needs a new runtime. This talk shows how bad of shape it's really in. https://www.youtube.com/watch?v=qCGofLIzX6g&list=PLRdS-n5seLRqszBqVDF342RMlCWgOTm
by ericfrederich 10y ago
Python needs a new runtime. This talk shows how bad of shape it's really in.
https://www.youtube.com/watch?v=qCGofLIzX6g&list=PLRdS-n5seLRqszBqVDF342RMlCWgOTm6q&index=11 https://www.youtube.com/watch?v=qCGofLIzX6g&list=PLRdS-n5seL...
Basically, the language doesn't have a "spec" per-se. The language is whatever the defacto CPython implementation happens to do within it's giant eval loop.
Another great talk about CPython internals:
http://pgbovine.net/cpython-internals.htm http://pgbovine.net/cpython-internals.htm
- dijit 10y agocpython is the reference implementation, so it makes sense that it's; A) Not well optimised. B) Touting features before the spec/standard. EDIT: people really dislike that I said this, and I'm having trouble finding my original citation- it was on one of the many python books I own. Most likely "Learn Python The Hard Way" but I'll dig out the exact chapter where they compare pypy to cpython and mention that because cpython is the reference implementation it values code clarity over performance optimisation.
- the_duke 10y agoIt makes sense that the official, primary and by far most popular implementation of one of the most used languages in existance is not well optimized? (edit: I'm just being polemic about your statement here. CPython is reasonably optimized within the constraints it currently has).
- nodja 10y agoIt only makes sense because it's python. A language where style is part of the syntax, and readability is one of the things that many libraries focus on , the so called being "pythonic". It makes sense that the reference implementation mirrors the same patterns than the language itself.
- the_duke 10y agoSomeone else already posted this link: https://www.youtube.com/watch?v=qCGofLIzX6g&list=PLRdS-n5seLRqszBqVDF342RMlCWgOTm6q&index=11 https://www.youtube.com/watch?v=qCGofLIzX6g&list=PLRdS-n5seL... It explains why CPython can't improve on many things.
- paulsmith 10y agoWho says CPython is not well-optimized? CPython is 25 years old -- people have been making it faster for a long time. Python 3.6, the latest release, has many performance improvements, cf. http://www.infoworld.com/article/3120952/application-development/hands-on-python-36s-speed-boost-matters.html http://www.infoworld.com/article/3120952/application-develop...
- trotterdylan 10y agoInterestingly, achieving performance parity with CPython is one of the biggest challenges of this project. There are certain things CPython does very fast like allocating and freeing many small objects.
- webmaven 10y agoSo, Grumpy currently isn't faster than CPython?
- deleted 10y ago[deleted]
- lima 10y agoNotably, some of the 3.6 performance improvements were merged in from PyPy :-)
- ericfrederich 10y agoPlease watch that first video, it's a good one. It explains how CPython essentially _is_ the spec because its internals leak into the spec when they have no business being there.
- dom0 10y agoPretty much the same is true about most other languages that have a single main implementation. This is even true, to some degree, for Java, which had competing implementations relatively early on.
- viraptor 10y agoAt some point it leaked pretty hard as well. The package scope was an unspecced implementation behaviour that became a standard later. (If I recall the story correctly)
- devy 10y ago> Basically, the language doesn't have a "spec" per-se. It does[1]. And process of improving it is called PEP[2]. [1]: https://docs.python.org/ https://docs.python.org/ [2]: https://en.wikipedia.org/wiki/Python_(programming_language)#Development https://en.wikipedia.org/wiki/Python_(programming_language)#...
- lomnakkus 10y agoUh, what? Claiming that your [1] is in any way a specification for the language is utterly absurd. It's far too vague. (Compare to even an IETF RFC, and you'll see what I mean. If you want to compare to a real language spec, compare to ISO C++.)
- orf 10y agoCPython is the spec (or really more the CPython test suite). Just like the Ruby MRI. It's a simple, plain interpreter without many frills, and to add or remove a feature you have to submit a PEP which goes through a specification process. Python started as a one-man-band project and of course didn't have a specification.
- lomnakkus 10y agoYes, but that's what the PP was arguing wasn't the case (by linking to a "spec"). I'm not sure why you're restating the obvious (OPs position).
- madgar 10y ago> Python started as a one-man-band project and of course didn't have a specification. C started as a one-man-band project and of course does have a specification. JavaScript started as a one-man-band project and of course does have a specification.
- orf 10y agoC wasn't a one man band project (at least a two-man-band one at the start!) and neither was JavaScript. C also didn't have a formal specification for over 20 years (only an informal one) and JavaScript had a strong selection bias for interpreters that roughly conformed to the specification. But that didn't exactly help it, JS is/was notorious for differing implementations of browser APIs. Each of them also has a strong need for a specification, as there are many differing compilers and interpreters. There are a few for Python but are specialized, the CPython interpreter is good enough for 90% of cases.
- lobster_johnson 10y agoThe reference [1] is a decent spec. It might not be as formally rigorous as an ISO standard, but it's probably as good as Go's [2], which also a "reference". [1] https://docs.python.org/3/reference/index.html https://docs.python.org/3/reference/index.html [2] https://golang.org/ref/spec https://golang.org/ref/spec
- jonathanyc 10y agoIn my experience with both languages, while the Go spec is incredibly readable, navigable, and succinct, the Python reference is a sprawling mess that is difficult to navigate or even to Ctrl-F in.
- vertex-four 10y agoTo be fair, Go is also a much smaller language, which hasn't gone through the process of collecting and shedding multiple layers of legacy, and exposes far fewer implementation details.