News for hackers. Stuff that matters.
Re:Grumpy: Go running Python by ericfrederich on Wednesday January 04, 2017 @12:39PM (#13320285)
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-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

Re:Grumpy: Go running Python by devy on Wednesday January 04, 2017 @02:12PM (#13321133)
> 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/

[2]: https://en.wikipedia.org/wiki/Python_(programming_language)#...

Re:Grumpy: Go running Python by lomnakkus on Wednesday January 04, 2017 @05:50PM (#13322868)
Uh, 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++.)
Re:Grumpy: Go running Python by guitarbill on Wednesday January 04, 2017 @08:13PM (#13323834)
> to a real language spec, compare to ISO C++.

No thanks. Written specs can always have interesting implications or undefined behaviour. Just because it's written in a more verbose language (English) doesn't mean it's less vague.

E.g. GGC is the de facto C spec for many. Code/platforms as spec makes more sense and is easier to maintain/update, with quicker iterations of language features (c.f. Ruby/Python to C++).

Re:Grumpy: Go running Python by lomnakkus on Wednesday January 11, 2017 @07:45PM (#13378923)
My issue isn't necessarily with the fact that it's in English. It's that it's hopelessly imprecise English. Maybe you'd have less of an issue with the Java Language Spec? (Which, IIRC, even left out some memory model problems until recently.)
Re:Grumpy: Go running Python by orf on Wednesday January 04, 2017 @07:26PM (#13323568)
CPython 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.

Re:Grumpy: Go running Python by lomnakkus on Wednesday January 04, 2017 @07:42PM (#13323661)
Yes, 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).
Re:Grumpy: Go running Python by madgar on Thursday January 05, 2017 @09:36AM (#13327363)
> 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.

Re:Grumpy: Go running Python by orf on Thursday January 05, 2017 @10:12AM (#13327650)
C 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.

Re:Grumpy: Go running Python by devy on Thursday January 05, 2017 @10:59AM (#13328146)
For your narrow minded understanding of what a programming language specification is only: https://en.wikipedia.org/wiki/Programming_language_specifica...

You can say it's imprecise or lack of ratification from one or many international organization(s), but you cannot say it doesn't exist. End of story.

Re:Grumpy: Go running Python by lobster_johnson on Wednesday January 04, 2017 @02:39PM (#13321358)
The 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

[2] https://golang.org/ref/spec

Re:Grumpy: Go running Python by jonathanyc on Wednesday January 04, 2017 @11:49PM (#13324839)
In 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.
Re:Grumpy: Go running Python by vertex-four on Thursday January 05, 2017 @04:45AM (#13325940)
To 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.
Re:Grumpy: Go running Python by dijit on Wednesday January 04, 2017 @12:46PM (#13320352)
cpython 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.

Re:Grumpy: Go running Python by paulsmith on Wednesday January 04, 2017 @12:54PM (#13320428)
Who 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-develop...

Re:Grumpy: Go running Python by trotterdylan on Wednesday January 04, 2017 @01:18PM (#13320650)
Interestingly, 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.
Re:Grumpy: Go running Python by webmaven on Friday January 06, 2017 @10:39AM (#13337079)
So, Grumpy currently isn't faster than CPython?
Re:Grumpy: Go running Python by lima on Wednesday January 04, 2017 @03:18PM (#13321689)
Notably, some of the 3.6 performance improvements were merged in from PyPy :-)
Re:Grumpy: Go running Python by the_duke on Wednesday January 04, 2017 @12:53PM (#13320414)
It 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).

Re:Grumpy: Go running Python by nodja on Wednesday January 04, 2017 @01:46PM (#13320929)
It 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.

Re:Grumpy: Go running Python by the_duke on Wednesday January 04, 2017 @01:48PM (#13320956)
Someone else already posted this link: https://www.youtube.com/watch?v=qCGofLIzX6g&list=PLRdS-n5seL...

It explains why CPython can't improve on many things.

Re:Grumpy: Go running Python by ericfrederich on Wednesday January 04, 2017 @01:27PM (#13320740)
Please 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.
Re:Grumpy: Go running Python by dom0 on Wednesday January 04, 2017 @01:42PM (#13320893)
Pretty 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.
Re:Grumpy: Go running Python by viraptor on Wednesday January 04, 2017 @04:53PM (#13322414)
At 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)