Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86105 > unrolled thread

Future of Pypy?

Started byDave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk>
First post2015-02-22 12:45 +0000
Last post2015-02-23 23:23 +0000
Articles 11 on this page of 71 — 19 participants

Back to article view | Back to comp.lang.python


Contents

  Future of Pypy? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-02-22 12:45 +0000
    Re: Future of Pypy? jkn <jkn_gg@nicorp.f9.co.uk> - 2015-02-22 04:58 -0800
      Re: Future of Pypy? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-02-22 15:30 +0000
        [OT] - BASIC is still not a bad choice, was Re: Future of Pypy? Michael Torrie <torriem@gmail.com> - 2015-02-23 17:24 -0700
    Re: Future of Pypy? Laura Creighton <lac@openend.se> - 2015-02-22 14:27 +0100
      Re: Future of Pypy? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-02-22 15:36 +0000
        Re: Future of Pypy? Laura Creighton <lac@openend.se> - 2015-02-22 18:22 +0100
          Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-22 11:02 -0800
            Re: Future of Pypy? Laura Creighton <lac@openend.se> - 2015-02-22 20:51 +0100
              Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-22 12:14 -0800
                Re: Future of Pypy? Laura Creighton <lac@openend.se> - 2015-02-22 23:13 +0100
                  Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-22 18:45 -0800
            Re: Future of Pypy? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-23 12:18 +1100
              Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-22 18:04 -0800
                Re: Future of Pypy? Chris Angelico <rosuav@gmail.com> - 2015-02-23 13:16 +1100
                Re: Future of Pypy? Ryan Stuart <ryan.stuart.85@gmail.com> - 2015-02-23 03:16 +0000
                  Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-22 19:45 -0800
                    Re: Future of Pypy? Ryan Stuart <ryan.stuart.85@gmail.com> - 2015-02-23 04:00 +0000
                      Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-22 22:13 -0800
                        Re: Future of Pypy? Ryan Stuart <ryan.stuart.85@gmail.com> - 2015-02-23 07:32 +0000
                          Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-23 16:11 -0800
                            Re: Future of Pypy? Chris Angelico <rosuav@gmail.com> - 2015-02-24 11:31 +1100
                              Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-23 17:50 -0800
                                Re: Future of Pypy? Chris Angelico <rosuav@gmail.com> - 2015-02-24 13:03 +1100
                                  Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-23 20:40 -0800
                                    Re: Future of Pypy? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-24 17:57 +1100
                                      Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-27 13:40 -0800
                                        Re: Future of Pypy? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-02-27 18:47 -0500
                            Are threads bad? - was: Future of Pypy? Ryan Stuart <ryan.stuart.85@gmail.com> - 2015-02-24 00:35 +0000
                              Re: Are threads bad? - was: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-23 21:27 -0800
                                Re: Are threads bad? - was: Future of Pypy? Chris Angelico <rosuav@gmail.com> - 2015-02-24 16:57 +1100
                                  Re: Are threads bad? - was: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-23 22:23 -0800
                                  Re: Are threads bad? - was: Future of Pypy? Marko Rauhamaa <marko@pacujo.net> - 2015-02-24 10:08 +0200
                                    Re: Are threads bad? - was: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-24 15:53 -0800
                                      Re: Are threads bad? - was: Future of Pypy? Marko Rauhamaa <marko@pacujo.net> - 2015-02-25 07:25 +0200
                                        Re: Are threads bad? - was: Future of Pypy? Marcos Almeida Azevedo <marcos.al.azevedo@gmail.com> - 2015-02-25 13:34 +0800
                                          Re: Are threads bad? - was: Future of Pypy? Marko Rauhamaa <marko@pacujo.net> - 2015-02-25 07:46 +0200
                                            Re: Are threads bad? - was: Future of Pypy? Chris Angelico <rosuav@gmail.com> - 2015-02-25 16:54 +1100
                                            Re: Are threads bad? - was: Future of Pypy? Marcos Almeida Azevedo <marcos.al.azevedo@gmail.com> - 2015-02-25 13:58 +0800
                                            Re: Are threads bad? - was: Future of Pypy? Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-24 23:02 -0700
                                            Re: Are threads bad? - was: Future of Pypy? Chris Angelico <rosuav@gmail.com> - 2015-02-25 17:07 +1100
                                            Re: Are threads bad? - was: Future of Pypy? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-02-25 16:37 +0000
                                            Re: Are threads bad? - was: Future of Pypy? Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-25 10:00 -0700
                                            Re: Are threads bad? - was: Future of Pypy? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-02-25 17:16 +0000
                                            Re: Are threads bad? - was: Future of Pypy? Chris Angelico <rosuav@gmail.com> - 2015-02-26 04:22 +1100
                                            Re: Are threads bad? - was: Future of Pypy? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-02-25 19:44 -0500
                                Re: Are threads bad? - was: Future of Pypy? Ryan Stuart <ryan.stuart.85@gmail.com> - 2015-02-25 00:59 +0000
                                  Re: Are threads bad? - was: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-26 21:55 -0800
                Re: Future of Pypy? Chris Angelico <rosuav@gmail.com> - 2015-02-23 14:25 +1100
                Re: Future of Pypy? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-23 18:41 +1100
                  Re: Future of Pypy? Marko Rauhamaa <marko@pacujo.net> - 2015-02-23 10:16 +0200
                  Re: Future of Pypy? Chris Angelico <rosuav@gmail.com> - 2015-02-23 20:19 +1100
                    Re: Future of Pypy? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-24 17:56 +1100
                      Re: Future of Pypy? Chris Angelico <rosuav@gmail.com> - 2015-02-24 18:16 +1100
                        Re: Future of Pypy? wxjmfauth@gmail.com - 2015-02-23 23:57 -0800
                  Re: Future of Pypy? Ethan Furman <ethan@stoneleaf.us> - 2015-02-23 11:39 -0800
                    Re: Future of Pypy? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-24 13:15 +1100
                  Re: Future of Pypy? Paul Rubin <no.email@nospam.invalid> - 2015-02-23 17:47 -0800
                    Re: Future of Pypy? Marko Rauhamaa <marko@pacujo.net> - 2015-02-24 10:12 +0200
        Re: Future of Pypy? Emile van Sebille <emile@fenx.com> - 2015-02-24 09:57 -0800
    Re: Future of Pypy? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-23 01:05 +1100
      Re: Future of Pypy? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-02-22 15:44 +0000
        Re: Future of Pypy? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-02-22 19:20 +0000
          Re: Future of Pypy? Laura Creighton <lac@openend.se> - 2015-02-22 22:45 +0100
            Re: Future of Pypy? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-02-23 14:04 +0000
              Re: Future of Pypy? Laura Creighton <lac@openend.se> - 2015-02-23 17:16 +0100
    Re: Future of Pypy? Terry Reedy <tjreedy@udel.edu> - 2015-02-23 01:34 -0500
    Re: Future of Pypy? Dave Cook <davecook@nowhere.net> - 2015-02-23 11:36 +0000
      Re: Future of Pypy? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-02-23 14:13 +0000
        Cython - was: Future of Pypy? Stefan Behnel <stefan_ml@behnel.de> - 2015-02-23 16:43 +0100
        Re: Future of Pypy? Dave Cook <davecook@nowhere.net> - 2015-02-23 23:23 +0000

Page 4 of 4 — ← Prev page 1 2 3 [4]


#86119

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2015-02-23 01:05 +1100
Message-ID<54e9e236$0$13004$c3e8da3$5496439d@news.astraweb.com>
In reply to#86105
Dave Farrance wrote:

> As an engineer, I can quickly knock together behavioural models of
> electronic circuits,  complete units, and control systems in Python, then
> annoyingly in a few recent cases, have to re-write in C for speed.
> 
> I've tried PyPy, the just-in-time compiler for Python, and that is
> impressively, hugely fast in comparison, but it's no good making these
> models if I can't display the results in a useful way, and at the moment
> PyPy just doesn't have the huge range of useful time-saving libraries that
> CPython has.

I assume you're talking about drawing graphics rather than writing text. Can
you tell us which specific library or libraries won't run under PyPy?



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#86130

FromDave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk>
Date2015-02-22 15:44 +0000
Message-ID<rasjeat6g8ucsf766011f3l9tsf4bcf7ps@4ax.com>
In reply to#86119
Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote:

>I assume you're talking about drawing graphics rather than writing text. Can
>you tell us which specific library or libraries won't run under PyPy?

Yes, mainly the graphics.  I'm a hardware engineer, not a software
engineer, so I might well be misunderstanding PyPy's current capability.

For easy-to-use vector graphics output, like 1980s BASIC computers, I've
settled on Pygame.  CPython libraries that I've used for other reasons
include Scipy, Matplotlib, PIL, CV2, and Kivy.

[toc] | [prev] | [next] | [standalone]


#86146

FromDave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk>
Date2015-02-22 19:20 +0000
Message-ID<32akealnfprmj3qha172e40c4cojk6cq56@4ax.com>
In reply to#86130
Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> wrote:

>Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote:
>
>>I assume you're talking about drawing graphics rather than writing text. Can
>>you tell us which specific library or libraries won't run under PyPy?
>
>Yes, mainly the graphics.  I'm a hardware engineer, not a software
>engineer, so I might well be misunderstanding PyPy's current capability.
>
>For easy-to-use vector graphics output, like 1980s BASIC computers, I've
>settled on Pygame.  CPython libraries that I've used for other reasons
>include Scipy, Matplotlib, PIL, CV2, and Kivy.

I see that PyPy's website says that PIL (Pillow) works.  I have so far
only used Python libraries that were readily available as binaries for
Windows, or were already available in Linux distro repositories.  In
Ubuntu, for example, Pillow is available for CPython but not PyPy.  Is
there a guide to tell me (in non-developer language, hopefully) how to
install Pillow for PyPy on Ubuntu?

[toc] | [prev] | [next] | [standalone]


#86160

FromLaura Creighton <lac@openend.se>
Date2015-02-22 22:45 +0100
Message-ID<mailman.19031.1424641552.18130.python-list@python.org>
In reply to#86146
Good news  -- it seems to be working fine with PyPy.
https://travis-ci.org/hugovk/Pillow/builds

for me, not extensively tested, it just seems to be working.

I have several pypy's floating around here, each within its own
virtualenv.  If you aren't familiar with virtualenv, read all
about it here:
http://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/

Note the first question to the blog writer is 'how to get it to work
with pypy'.  Do what he says.  virtualenv -p /path/to/pypy env
but, if you want to use more bleeding edge pypy you will want:

# from a tarball
$ virtualenv -p /opt/pypy-c-jit-41718-3fb486695f20-linux/bin/pypy my-pypy-env

# from the mercurial checkout
$ virtualenv -p /path/to/pypy/pypy/translator/goal/pypy-c my-pypy-env

I've only got bleeding edge PyPys around here, in virtualenvs, but
in all of them

import sys
from PIL import Image

for infile in sys.argv[1:]:
   try:
       with Image.open(infile) as im:
             print(infile, im.format, "%dx%d" % im.size, im.mode)
   except IOError:
             pass

which I pasted right in from
http://pillow.readthedocs.org/en/latest/handbook/tutorial.html

seems to be working just fine for me.  Hardly an exhaustive test,
but ... well, try it and see how it goes for you.

I don't know what time it is where you are, but it is 22:44 here now, and
alas I promised a kivy demo to a client tomorrow morning, and, double
alas, I haven't written it yet.  It shouldn't take more than an hour or
three to write, but I am going to have to stop having pleasant chats
about pypy for a while and get this thing done ... :)

Laura



[toc] | [prev] | [next] | [standalone]


#86222

FromDave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk>
Date2015-02-23 14:04 +0000
Message-ID<hmameah1nai9ma91fdr9lr5u4df40of1r5@4ax.com>
In reply to#86160
Laura Creighton <lac@openend.se> wrote:

>Good news  -- it seems to be working fine with PyPy.
>https://travis-ci.org/hugovk/Pillow/builds
>
>for me, not extensively tested, it just seems to be working.
>
>I have several pypy's floating around here, each within its own
>virtualenv.  If you aren't familiar with virtualenv, read all
>about it here:
>http://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/

OK, thanks. I had to do a bit of experimenting to find something that
worked.  The "virtualenv" that came with Ubuntu failed in various ways if
used with PyPy.  But after downloading this and that via the PyPy download
webpage, I found that "Squeaky's portable Linux binaries" contained
'virtualenv-pypy' which worked OK, then Pillow installed OK with "pip".

It does seem that the PyPy that you get from the Ubuntu repository (and
presumably as packaged in most Linux distros) is rather limited.  Other
than the core libraries included with the PyPy package itself, all that's
in the repository for PyPy is Tk and an ImageMagick interface and that's
it.  CPython, on the other hand, has more repository packages than I can
count -- hundreds, I think.  So as a non-developer linux-user, I had just
installed Python packages from the repository, rather than using pip, as
would most linux users I would guess.  So that's why I got the impression
that PyPy had almost no library support.

[toc] | [prev] | [next] | [standalone]


#86235

FromLaura Creighton <lac@openend.se>
Date2015-02-23 17:16 +0100
Message-ID<mailman.19080.1424708194.18130.python-list@python.org>
In reply to#86222
Arrgh!  I forgot to warn you that you need a very recent version of
virtualenv to work with PyPy.  I am very sorry about that.  Glad to
see that things are working now.

Laura

[toc] | [prev] | [next] | [standalone]


#86197

FromTerry Reedy <tjreedy@udel.edu>
Date2015-02-23 01:34 -0500
Message-ID<mailman.19056.1424673270.18130.python-list@python.org>
In reply to#86105
On 2/22/2015 7:45 AM, Dave Farrance wrote:
> As an engineer, I can quickly knock together behavioural models of
> electronic circuits,  complete units, and control systems in Python, then
> annoyingly in a few recent cases, have to re-write in C for speed.
>
> I've tried PyPy, the just-in-time compiler for Python, and that is
> impressively, hugely fast in comparison, but it's no good making these
> models if I can't display the results in a useful way, and at the moment
> PyPy just doesn't have the huge range of useful time-saving libraries that
> CPython has.  It's still quicker to do a re-write in the more cumbersome C
> than try to work with PyPy because C, like CPython, also has many useful
> libraries.
>
> A few years back, I recall people saying that PyPy was going to be the
> future of Python, but it seems to me that CPython still has the lion's
> share of the momentum, is developing faster and has ever more libraries,
> while PyPy is struggling to get enough workers to even get Numpy
> completed.
>
> Maybe there's not enough people like me that have really felt the need for
> the speed.  Or maybe it's simply the accident of the historical
> development path that's set-in-stone an interpreter rather than a JIT.
> Anybody got a useful perspective on this?
>


-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#86206

FromDave Cook <davecook@nowhere.net>
Date2015-02-23 11:36 +0000
Message-ID<54eb10cf$0$44508$c3e8da3$66d3cc2f@news.astraweb.com>
In reply to#86105
On 2015-02-22, Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> wrote:

> It's still quicker to do a re-write in the more cumbersome C

You should try Cython.

Dave

[toc] | [prev] | [next] | [standalone]


#86223

FromDave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk>
Date2015-02-23 14:13 +0000
Message-ID<hscmeah7d6cvlanol6j4ln6dn8arvqa14t@4ax.com>
In reply to#86206
Dave Cook <davecook@nowhere.net> wrote:

>On 2015-02-22, Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> wrote:
>
>> It's still quicker to do a re-write in the more cumbersome C
>
>You should try Cython.

I did try Cython when I was trying to figure out what to do about the slow
speed.  My initial attempt showed no speedup at all.  The documentation
told me that I needed to change the data types to special C-like types, so
it seemed to me that it would become half way between Python and C and
would be as cumbersome to develop as C.  So at that point, I just rewrote
it in C.

Anyway, now that I've been told how to install libraries in PyPy, I'll
probably be able to use PyPy if I need speedups in future.

[toc] | [prev] | [next] | [standalone]


#86229 — Cython - was: Future of Pypy?

FromStefan Behnel <stefan_ml@behnel.de>
Date2015-02-23 16:43 +0100
SubjectCython - was: Future of Pypy?
Message-ID<mailman.19077.1424706233.18130.python-list@python.org>
In reply to#86223
Dave Farrance schrieb am 23.02.2015 um 15:13:
> Dave Cook wrote:
>> On 2015-02-22, Dave Farrance wrote:
>>
>>> It's still quicker to do a re-write in the more cumbersome C
>>
>> You should try Cython.
> 
> I did try Cython when I was trying to figure out what to do about the slow
> speed.  My initial attempt showed no speedup at all.  The documentation
> told me that I needed to change the data types to special C-like types, so
> it seemed to me that it would become half way between Python and C and
> would be as cumbersome to develop as C.  So at that point, I just rewrote
> it in C.

The main selling point of Cython is that, while it gives you the speed of C
if you write C-ish code (because it translates it to the obvious C code),
you don't have to write that C-ish code unless you decide to do so. Right
the next line, you can use a set comprehension or yield a value back from a
generator. So, it's not "half way between Python and C", it actually covers
both, almost entirely. (Oh, and also C++, if you feel like it.)

Stefan

[toc] | [prev] | [next] | [standalone]


#86275

FromDave Cook <davecook@nowhere.net>
Date2015-02-23 23:23 +0000
Message-ID<54ebb654$0$14741$b1db1813$46decd27@news.astraweb.com>
In reply to#86223
On 2015-02-23, Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> wrote:

> I did try Cython when I was trying to figure out what to do about the slow
> speed.  My initial attempt showed no speedup at all.  The documentation
> told me that I needed to change the data types to special C-like types, so
> it seemed to me that it would become half way between Python and C and
> would be as cumbersome to develop as C.  So at that point, I just rewrote
> it in C.

Right, you have add type info to get the speedup.  This can be done as
needed.  What Cython provides is a transparent interface between the C
compiler and Python, without the need for any wrapper code.  I'm
curious about the process you use to interface to C that is less
cumbersome.

Dave Cook

[toc] | [prev] | [standalone]


Page 4 of 4 — ← Prev page 1 2 3 [4]

Back to top | Article view | comp.lang.python


csiph-web