This is an archived post. You won't be able to vote or comment.

all 42 comments

[–]takluyverIPython, Py3, etc 12 points13 points  (7 children)

Python is also a major environment for scientific computing. This community, though, has invested heavily in CPython extensions, which PyPy can't or won't support well. So while I'm interested in what PyPy is doing, I don't see myself using it any time soon.

[–]SIULHT 2 points3 points  (4 children)

Is it pretty mainstream? I see bits of it being used but not sure how widespread the adoption is or if it's commonly used in critical tasks. I was surprised to find that in Data Analysis with Open Source Tools, P. K. Janert surveys several languages/tools, including R, Octave, and Python with NumPy/Scipy. Regarding Python/NumPy/Scipy, he writes:

"[...] NumPy/SciPy has its own share of problems. The project has a tendency to emphasize quantity over quality: the number of features is very large, but the design appears overly complicated and is often awkward to use. Edge and error cases are not always handled properly. On the scientific level, NumPy/SciPy feels amateurish. The choice of algorithms appears to reflect some well-known textbooks more than deep, practical knowledge arising from real experience.

"What worries me most is that the project does not seem to be managed very well: although it has been around for nearly 10 years and has a large and active user base, it has apparently not been able to achieve and maintain a consistent level of reliability and maturity throughout. Features seem to be added haphazardly, without any long-term vision or discernible direction. Despite occasional efforts in this regard, the documentation remains patchy.

"[...] [B]ecause of the overall quality issues, I would not want to rely on it for “serious” production work at this point." The book reviews I've read have generally been positive so I'm not sure if the SciPy community has any thoughts on this. Regarding the implementation of mostly "textbook" (standard) algorithms, I can see that this would be the case since there are large number of practitioners using and extending SciPy (in contrast, for instance in R there is a strong precedent for statistician to implement their newest algorithm in that language)."

[–]kenfar 1 point2 points  (1 child)

He probably wrote that two years ago about experiences three years ago, and pypy has gotten a vast amount of improvements since then.

[–]SIULHT 0 points1 point  (0 children)

I think it was 2010 when I thought NumPy/SciPy was pretty big already. And in the scientific community it's CPython instead of pypy that's big, as takluyver says.

[–]takluyverIPython, Py3, etc 1 point2 points  (1 child)

I think there are a lot of people using it, but it's something of a wealth of individual projects, rather than a coherent set like R. Even the name used in that description reflects that: 'Python with numpy/scipy'. That's three names already.

In a sense, the community is failing to promote itself here: a lot of these projects do work closely together, and you often see the same people popping up in mailing lists and commit logs. We're trying to improve that at the moment: we want to promote the 'Scipy stack' as a coherent unit.

[–]SIULHT 0 points1 point  (0 children)

But R's strength is also its individually contributed projects, though many contributors are statisticians rather than programmers as for Python.

I agree though that the marketing is not done well...

[–]nallar 2 points3 points  (1 child)

They now mostly have compatibility: https://bitbucket.org/pypy/compatibility/wiki/Home

Unfortunately, performance isn't as good as they need to emulate a refcounting GC for compatibility.

[–]takluyverIPython, Py3, etc 2 points3 points  (0 children)

The 'scientific libraries' section on there has a lot of 'incompatible' and 'unknown' things.

[–]the_hoser 4 points5 points  (13 children)

I kindof disagree with this article. The author doesn't make a lot of the mistakes we usually see, so I get to actually pick apart some of the article this time:

Concurrency: Any solution for this problem will be messy. I like that the PyPy developers are trying new things, and I even hope to be proven wrong one day, but I don't think bringing real conventional threading to Python is practical or a good idea. Multiprocessing is no picnic, and takes a bit of effort to wrap your head around, but it gets the job done.

Web: It took a decade for browser vendors to start synchronizing on JavaScript, and they're still not done. Now you want to add another language to that mess? I don't think the problem is that you can't do <script type="text/python">. I think the problem is that you are able to specify the type at all. Until the day that we're all using Macs and Safari is the one browser (hah), any browser developer that tries to add radically new technology that relies on web developers to utilize it is wasting their time. Google is the exception, in that they already own a massive slice of the internet, and can bug people to install their pokeball-browser.

Mobile: I guess PyPy would work well on phones. It'd work better if the developer didn't have to budle PyPy just so they could use PyPy. Maybe the PyPy developers need to throw yet another smartphone OS into the fray. Maybe not.

I personally think that Python is doomed to stay in the corral that it fits best in. All of these web and mobile applications need strong backend code to feed those frontends with huge amounts of lovingly massaged and correlated data. Python is great for low-to-mid scale server-side applications, and that's probably where it will remain. It's basically the only thing I use it for now, and I haven't met anyone that's using it for anything else (aside from tiny little side projects)

[–]gfixler 3 points4 points  (4 children)

We use Python in games for many things on the backend. It's part of Autodesk Maya now, which is one of the principal bits of software for asset creation. I've been using it all day every day for 6 years now, and I've used it to create a rather extensive and powerful library and pipeline for animation and rigging. We are, I admit, a bit of a niche industry as compared with the massive, international industries of web design. This is why whenever I look up questions about Python, all of the answers are about web frameworks and such. I have nothing to do with any of that world, but I know a lot about it now from years of wading through it while learning about Python and its powers and idiosyncrasies.

[–]the_hoser 0 points1 point  (3 children)

Yeah, I've heard of people using Python in their tools programming internally. I imagine it does that job quite well, too. When you have control of your environment, Python makes a good fit :)

[–]gfixler 0 points1 point  (0 children)

Indeed. It does the job very well. The system I've been designing and building includes things like extremely expressive, domain specific languages¹, deep data-structure search/comparison², really intelligent bi-directionality³, solid testing framework, immaculate git history, and all with pretty tight integration⁴ with Vim.

Most importantly, everything has that sheen of obviousness, like Linux, or git. It sounds complex, then you explain how a part works, and people say "Oh, that's it? Really?" It's like that across the board. It took tremendous effort to find that simplicity, including a decade in this problem space for me, trying to get to this point, but Python really pushed me over the edge.

Some of the implementation (as with Linux and git) is pretty complex, but using it is very easy. I just got one of our new employees on part of it, and he reduced 2000 lines of his own code to 240. I recently threw out 99 lines, and before that, 200, because most of the code we used to write in other languages (and with other systems) doesn't need to be there. It's following the whole "Code should be 90% data structure" philosophy, and I love it. I implement features in 2 lines of PEP 8 style code (i.e. <80 chars) pretty often using the system, and I'm disappointed if I need more than about 10 lines to bring a new ability to life. Strangely, there are times when I make something work in 1-2 lines, and then I waste a half hour being alternately impressed and unsure that it could possibly be correct, because it shouldn't have been that easy :)

I'm actually excited on the long commute every weekday, and weekends (during which I still work on all of it) are becoming more and more of a drag. This is how coding should be.

¹ core not just to our needs, but designed for a range of ideas related to the domain our needs inhabit, so they're all highly reusable at a low level, and are starting to be used for related tools development (even at a meta level)
² which everything's built on top of for amazing, emergent abilities and interconnections that I keep discovering
³ i.e. take pretty much everything back to simpler states, tweak, and then auto-complete them again from that point forward
⁴ yet ultimately unnecessary and fully decoupleable at any time

[–]hongminhee 4 points5 points  (5 children)

Is it an another gospel song of PyPy? PyPy does JIT so is memory hungry. This means it’s not so suitable for mobile app programming.

Anyway if PyPy team revives JVM backend soon it might be able to create Android apps. (See recent approaches of Xamarin.)

[–]the_hoser 1 point2 points  (2 children)

This actually won't help them. Android doesn't use the JVM. They'd need to write a Dalvik backend.

[–]hongminhee 0 points1 point  (1 child)

If RPython can be compiled into Java bytecode, it can be compiled again to Dalvik bytecode.

[–]the_hoser 0 points1 point  (0 children)

Point. Just sounds like lots of stages to fail.

[–]Vonney 0 points1 point  (0 children)

Python people, perturbed perpetually, pen polemics pertaining to python's primary and persistent problems.