News for hackers. Stuff that matters.
Re:PyPy's future directions by overgard on Saturday October 08, 2011 @02:28PM (#3088562)
I think one of the most exciting things about PyPy that sometimes get lost is that it's not only a great interpreter, it's a great interpreter construction toolset. I like python the language itself quite a bit, but if I were writing an interpreter for a new language PyPy would probably be the platform I'd want to implement it on.
Re:PyPy's future directions by corysama on Saturday October 08, 2011 @03:00PM (#3088653)
http://morepypy.blogspot.com/2011/04/tutorial-part-2-adding-...

"Translating RPython to C is pretty cool, but one of the best features of PyPy is its ability to generate just-in-time compilers for your interpreter. That's right, from just a couple hints on how your interpreter is structured, PyPy will generate and include a JIT compiler that will, at runtime, translate the interpreted code of our BF language to machine code!"

Re:PyPy's future directions by po on Saturday October 08, 2011 @08:55PM (#3089293)
Hmm... I wonder how hard a native CoffeeScript on pypy would be...
Re:PyPy's future directions by piranha on Sunday October 09, 2011 @02:00AM (#3089800)
Or JavaScript, that would work as well.
Re:PyPy's future directions by po on Sunday October 09, 2011 @02:27AM (#3089845)
Re:PyPy's future directions by gnuvince on Saturday October 08, 2011 @09:32PM (#3089365)
I was doing a homework for an algorithms class today. I wrote a quick implementation in Python with some quickcheck tests to make sure it worked correctly. Running 10,000 tests with CPython 2.7 took 136s on my laptop. For fun, I tried with the latest PyPy and it ran the 10,000 tests in 30s. This is very impressive and I am definitely going to start using PyPy more often.
Re:PyPy's future directions by odiroot on Sunday October 09, 2011 @01:10AM (#3089728)
I have been recently porting to Python (with NumPy) some badly written C++ code. I was really shocked that the performance drops nearly 100 times (because of many nested loops).

NumPy working on PyPy would probably get me really near original performance. And it's not the advanced features I hope for -- ndarray and basic linalg operations is all I need to do my thesis.

Anyway guys, great job so far, looking forward to the future.

Re:PyPy's future directions by cdavid on Sunday October 09, 2011 @04:17AM (#3089997)
If you have nested loops, numpy will indeed not help you. Numpy per-item access is actually slower than python usual container (list, tuple). You could post the code that is actually slow, so that one could help you to make it faster.

As for pypy helping you, I hope that's the case. But what's in pypy today has not much to do with numpy, in the sense it is a complete re-implementation from scratch.

Re:PyPy's future directions by bugsbunnyak on Sunday October 09, 2011 @11:39AM (#3090616)
Have a look at suggestions here:

http://scipy-lectures.github.com/advanced/optimizing/index.h...

By far the most important first-order optimizization is to vectorize your computations.

Re:PyPy's future directions by femngi on Sunday October 09, 2011 @12:45PM (#3090745)
You should read http://www.scipy.org/PerformancePython if you haven't already seen it since it deals with the performance of nested loops. The only issue I guess would be portability, for example to PyPy.
Re:PyPy's future directions by odiroot on Monday October 10, 2011 @04:11AM (#3092762)
I totally missed this guide. I'd definitely use Cython to optimize this.

Previously I used Cython to wrap original C++ code and it performed really well but I got numerical differences in result.

Re:PyPy's future directions by fijal on Sunday October 09, 2011 @12:50PM (#3090756)
This does not cover PyPy and under PyPy behavior of those methods will be Very different.
Re:PyPy's future directions by thadeus_venture on Saturday October 08, 2011 @04:10PM (#3088781)
What are the options for using pypy with wsgi?
Re:PyPy's future directions by masklinn on Saturday October 08, 2011 @04:45PM (#3088855)
Any pure-python WSGI server works: gunicorn, cherrypy's server, wsgiref/werkzeug.serve, probably Aspen.

I'm pretty certain mod_wsgi does not work with Pypy (it uses Python's embedding API, which Pypy does not implement), I have no idea about uWSGI although messages like this: http://lists.unbit.it/pipermail/uwsgi/2011-March/001641.html make me thing it should be possible.

Re:PyPy's future directions by JeffJenkins on Saturday October 08, 2011 @08:21PM (#3089235)
Also, Tornado, which may be twice as fast:

http://groups.google.com/group/python-tornado/browse_thread/...

Re:PyPy's future directions by masklinn on Sunday October 09, 2011 @05:30AM (#3090107)
As far as I know, while a Tornado (framework) application can run in a WSGI server via tornado.wsgi, Tornado's evented server does not support mounting WSGI application.

thadeus_venture was specifically asking about WSGI.

Re:PyPy's future directions by vog on Sunday October 09, 2011 @10:18AM (#3090477)
Why does the official Python development still take part in CPython rather than PyPy? Is there anything seriously wrong with PyPy, so it can't replace CPython by now?
Re:PyPy's future directions by dmbaggett on Sunday October 09, 2011 @10:55AM (#3090547)
The main reason, aside from simple inertia, is that C extension API support is still only alpha.