Re: [pypy-dev] Pypy custom interpreter JIT question

2011-04-04 Thread Andrew Brown
Submitted for everyone's approval, I've written a draft of a pypy tutorial
going over everything I learned in writing this example interpreter.

https://bitbucket.org/brownan/pypy-tutorial/src

See the main document at tutorial.rst

https://bitbucket.org/brownan/pypy-tutorial/src/c0bebf4728a5/tutorial.rstI'd
love some feedback on it. I've made an effort to keep things accurate yet
simple, but if there are any inaccuracies, let me know. Or fork the repo and
make the correction yourself =)

-Andrew

On Thu, Mar 31, 2011 at 6:29 PM, Alex Gaynor alex.gay...@gmail.com wrote:



 On Thu, Mar 31, 2011 at 6:00 PM, Antonio Cuni anto.c...@gmail.com wrote:

 On 31/03/11 22:05, Andrew Brown wrote:

  python double-interpreted:  78m (did not finish)
  pypy-c (with jit) double-interpreted: 41m 34.528s

 this is interesting. We are beating cpython by more than 2x even in a
 worst
 case scenario, because interpreters in theory are not a very good target
 for
 tracing JITs.
 However, it's not the first time that we experience this, so it might be
 that
 this interpreter/tracing JIT thing is just a legend :-)


 Well the issue with tracing an interpreter is the large number of paths, a
 brainfuck interpreter has relatively few paths compared to something like a
 Python VM.




  translated interpreter no jit: 45s
  translated interpreter jit: 7.5s
  translated direct to C, gcc -O0
translate: 0.2s
compile: 0.4s
run: 18.5s
  translated direct to C, gcc -O1
translate: 0.2s
compile: 0.85s
run: 1.28s
  translated direct to C, gcc -O2
translate: 0.2s
compile: 2.0s
run: 1.34s

 these are cool as well. We are 3x faster than gcc -O0 and ~3x slower than
 -O1
 and -O2.  Pretty good, I'd say :-)

 ciao,
 anto
 ___
 pypy-dev@codespeak.net
 http://codespeak.net/mailman/listinfo/pypy-dev


 Alex

 --
 I disapprove of what you say, but I will defend to the death your right to
 say it. -- Evelyn Beatrice Hall (summarizing Voltaire)
 The people's good is the highest law. -- Cicero


___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

Re: [pypy-dev] Pypy custom interpreter JIT question

2011-04-04 Thread Carl Friedrich Bolz
On 04/04/2011 04:12 PM, Andrew Brown wrote:
 Submitted for everyone's approval, I've written a draft of a pypy
 tutorial going over everything I learned in writing this example
 interpreter.

 https://bitbucket.org/brownan/pypy-tutorial/src

 See the main document at tutorial.rst

 https://bitbucket.org/brownan/pypy-tutorial/src/c0bebf4728a5/tutorial.rstI'd
 love some feedback on it. I've made an effort to keep things accurate
 yet simple, but if there are any inaccuracies, let me know. Or fork the
 repo and make the correction yourself =)

Looks very nice! Would you be up to making a guest post out of this on 
the PyPy blog?

Carl Friedrich
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev


Re: [pypy-dev] Pypy custom interpreter JIT question

2011-04-04 Thread Andrew Brown
On Mon, Apr 4, 2011 at 11:22 AM, Carl Friedrich Bolz cfb...@gmx.de wrote:


 Looks very nice! Would you be up to making a guest post out of this on
 the PyPy blog?

 Sure! What needs to be done to turn it into a blog post and get it posted?
I assume there are format considerations, but I'm also open to any content
suggestions and feedback before it goes live.

-Andrew
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

Re: [pypy-dev] Pypy custom interpreter JIT question

2011-04-04 Thread Carl Friedrich Bolz
On 04/04/2011 05:43 PM, Andrew Brown wrote:
 On Mon, Apr 4, 2011 at 11:22 AM, Carl Friedrich Bolz cfb...@gmx.de
 mailto:cfb...@gmx.de wrote:


 Looks very nice! Would you be up to making a guest post out of this on
 the PyPy blog?

 Sure! What needs to be done to turn it into a blog post and get it
 posted? I assume there are format considerations, but I'm also open to
 any content suggestions and feedback before it goes live.

I looked again, added two places that could use small fixes. And I 
updated two links, see my merge request. Apart from that, the blog post 
would not need many changes. It would need an introductionary line like:

This is a guest post by Andrew Brown. It's a tutorial for how to write 
an interpreter with PyPy, generating a JIT. It is suitable for beginners 
and assumes very little knowledge of PyPy.

Then we should link to the repo, and replace all file links with links 
to bitbucket. I can do all that, and post it (tomorrow), if you are fine 
with that.

Carl Friedrich
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev


Re: [pypy-dev] Pypy custom interpreter JIT question

2011-04-04 Thread Antonio Cuni
On 04/04/11 17:43, Andrew Brown wrote:

 Sure! What needs to be done to turn it into a blog post and get it posted? I
 assume there are format considerations, but I'm also open to any content
 suggestions and feedback before it goes live.

Hello Andrew,
thanks for the tutorial, it's really well written and easy to read.

Two notes:

1) do you know about the existence of rlib.streamio? It's is part of the
RPython standard library and it allows you to read/write files in a higher
level way than file descriptors

2) Maybe the tutorial is a bit too long to fit in just one post; what about
splitting it into two parts? (e.g., one until Adding JIT and one after).

ciao,
Anto
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev


Re: [pypy-dev] Pypy custom interpreter JIT question

2011-04-04 Thread Andrew Brown
Thanks for the feedback. I'll clarify those parts, and I have a few
touch-ups of my own. Also, I think I forgot to add my name =)

I'm fine with you posting it as you described. An into line like that was
just what I had in mind. I'd wait until tomorrow though to see if any other
feedback surfaces.

On Mon, Apr 4, 2011 at 12:17 PM, Carl Friedrich Bolz cfb...@gmx.de wrote:

 On 04/04/2011 05:43 PM, Andrew Brown wrote:

 On Mon, Apr 4, 2011 at 11:22 AM, Carl Friedrich Bolz cfb...@gmx.de
 mailto:cfb...@gmx.de wrote:


Looks very nice! Would you be up to making a guest post out of this on
the PyPy blog?

 Sure! What needs to be done to turn it into a blog post and get it
 posted? I assume there are format considerations, but I'm also open to
 any content suggestions and feedback before it goes live.


 I looked again, added two places that could use small fixes. And I updated
 two links, see my merge request. Apart from that, the blog post would not
 need many changes. It would need an introductionary line like:

 This is a guest post by Andrew Brown. It's a tutorial for how to write an
 interpreter with PyPy, generating a JIT. It is suitable for beginners and
 assumes very little knowledge of PyPy.

 Then we should link to the repo, and replace all file links with links to
 bitbucket. I can do all that, and post it (tomorrow), if you are fine with
 that.

 Carl Friedrich

___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

Re: [pypy-dev] Pypy custom interpreter JIT question

2011-04-04 Thread Andrew Brown
On Mon, Apr 4, 2011 at 12:34 PM, Antonio Cuni anto.c...@gmail.com wrote:

 1) do you know about the existence of rlib.streamio? It's is part of the
 RPython standard library and it allows you to read/write files in a
 higher
 level way than file descriptors

 No, I didn't. That's good to know. I don't think it's worth updating the
examples though, so unless you disagree, I'll just add a note about this
module's existence.


 2) Maybe the tutorial is a bit too long to fit in just one post; what about
 splitting it into two parts? (e.g., one until Adding JIT and one after).

 Yes, it is quite long.

Carl, feel free to break it up as necessary when you post it. Breaking it up
at the Adding JIT section seems ideal, since both parts are useful on
their own.

-Andrew
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

Re: [pypy-dev] Pypy custom interpreter JIT question

2011-04-04 Thread Antonio Cuni
On 04/04/11 19:46, Andrew Brown wrote:

 1) do you know about the existence of rlib.streamio? It's is part of the
 RPython standard library and it allows you to read/write files in a 
 higher
 level way than file descriptors
 
 No, I didn't. That's good to know. I don't think it's worth updating the
 examples though, so unless you disagree, I'll just add a note about this
 module's existence.

sure, I think that for this example, using fd is fine.

Btw, in case you want to do more with pypy, having a look to rlib might be a
good idea, there is useful stuff there :)

ciao,
Anto
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev


Re: [pypy-dev] Pypy custom interpreter JIT question

2011-04-04 Thread Andrew Brown
On Mon, Apr 4, 2011 at 2:12 PM, Antonio Cuni anto.c...@gmail.com wrote:

 sure, I think that for this example, using fd is fine.

 Btw, in case you want to do more with pypy, having a look to rlib might be
 a
 good idea, there is useful stuff there :)

 Definitely.

In any case, I've made some changes, re-worded some things. Carl, I've
addressed your suggestions, let me know what you think.

I also re-worded a few things in the Adding JIT section to make it flow a
bit better assuming it will be split up. It may still need some editing
though.

-Andrew
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

[pypy-dev] A Little Bit of Python Episode 17

2011-04-04 Thread Michael Foord
An interview with Armin, recorded at the Leysin sprint:

http://advocacy.python.org/podcasts/littlebit/2011-04-04.mp3

It turned out pretty well I think.

All the best,

Michael Foord

-- 

http://www.voidspace.org.uk/

May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

[pypy-dev] PyPy in the benchmarks game - yes or no?

2011-04-04 Thread Isaac Gouy
Hi

A simple yes / no question.

Do you want PyPy to be shown in the benchmarks game or not?

Please consider the question amongst yourselves and then let me know. 

Of course, I'll make up my own mind but at least I'll be able to take your 
wishes into account.

best wishes, Isaac


  
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev


Re: [pypy-dev] PyPy in the benchmarks game - yes or no?

2011-04-04 Thread Dima Tisnek
On 4 April 2011 17:23, Isaac Gouy igo...@yahoo.com wrote:
 Hi

 A simple yes / no question.

 Do you want PyPy to be shown in the benchmarks game or not?

 Please consider the question amongst yourselves and then let me know.

 Of course, I'll make up my own mind but at least I'll be able to take your 
 wishes into account.

 best wishes, Isaac



 ___
 pypy-dev@codespeak.net
 http://codespeak.net/mailman/listinfo/pypy-dev


I think it ought to be included, although I have big reservation about
some of the benchmarks. Some work and/or discussion on benchmarks
would be in order.

my 2c. d.
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev


[pypy-dev] minimum system requirements, build configuration

2011-04-04 Thread Liam Staskawicz
Hi - I've been looking at pypy as a possible application runtime in an ARM9 
Linux based system. I understand that the in-progress ARM jit backend targets 
only ARMv7, but I'm still interested in characterizing a translated pypy-c 
interpreter on this system with regard to CPU and memory usage. Of course I 
look forward to possible ARMv5 support for the jit in the future, but if I've 
understood correctly, fully interpreted mode should be supported - please let 
me know if this is not correct!

To that end, are there minimum recommended system requirements for pypy, 
specifically in terms of memory? As a reference, something like the Mono 'Small 
Footprint' wiki page applied to pypy would be what I'm looking for: 
http://www.mono-project.com/Small_footprint

On a related note, most of the build config info I've come across seems to 
revolve around a scratchbox2 build environment targeting maemo - indeed it 
seems to be the main other 'platform' option in the pypy build script, other 
than 'host'. Is there any particularly tight coupling between maemo and pypy, 
or should I hope to be able to set up a generic sbox2 environment for my target 
and come away with a working build? Are there any other docs or config snippets 
that detail how to set up a generic cross compile environment for pypy?

Thanks for any tips or relevant info!

Liam ___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

Re: [pypy-dev] PyPy in the benchmarks game - yes or no?

2011-04-04 Thread William ML Leslie
On 5 April 2011 10:23, Isaac Gouy igo...@yahoo.com wrote:
 Hi

 A simple yes / no question.

 Do you want PyPy to be shown in the benchmarks game or not?

 Please consider the question amongst yourselves and then let me know.

There seems to have been general confusion here about what the
implementations of these benchmarks are supposed to represent.  Are
they to be representative of idiomatic code, or optimised for a
particular implementation?  Or something else entirely?  Since pypy
have generally tried to optimise for and encourage idiomatic python
usage, those benchmark implementations that go to great length to use
confusing and non-standard performance hacks represent neither the
performance of real-world code, nor what one can do with a specific
implementation.

If the answer is that they are going to be tuned to a particular
implementation and that implementation is not going to be ours, we
probably *could* live with that: realistically, the sort of code
people are applying pypy to occasionally contains performance hacks
that are no longer relevant and possibly detrimental.  But it does
seem to change the meaning of the benchmark, and it would be useful to
get some authoritative clarification on this before we consider it.

-- 
William Leslie
___
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev