News for hackers. Stuff that matters.
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by wyldfire on Thursday October 29, 2015 @09:15AM (#10470700)
Kudos to the pypy team! I suspect pypy would benefit from some kind of marketing campaign. It rarely lets me down and yet lots of python devs don't know about it.

The most popular package(s) that don't work with it have been numpy, scipy, etc. When I first encountered pypy, there was a numpypy and I wouldn't be surprised if that's different now. But bottom line, tons of python code out there needs more performance and has no dependency on numpy or any C extensions.

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by pjmlp on Thursday October 29, 2015 @09:26AM (#10470776)
> But bottom line, tons of python code out there needs more performance and has no dependency on numpy or any C extensions.

What they need is nice JIT engines like PyPy and not to switch languages.

If no one invested in improving implementations for modern languages and switched to something lower level all the time, we would still be using Fortran for business applications.

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by baldfat on Thursday October 29, 2015 @11:12AM (#10471621)
We still are using FORTRAN for Business Applications and I fail to see the need to switch them to a slower language to modernize them. Unless the switch is solving a program leave them alone. This is why in R there is still plenty of FORTRAN code.

Personally I LOVE Python but I always feel it is the 2nd best choice. I do use Python but it rarely is the best tool to use for the problem you are solving. Maybe Pypy will turn this around, and I hope so.

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by jzd on Thursday October 29, 2015 @01:17PM (#10472631)
How can SciPy be fast if it is written in an interpreted language like Python?

Actually, the time-critical loops are usually implemented in C or Fortran. Much of SciPy is a thin layer of code on top of the scientific routines that are freely available at http://www.netlib.org/. Netlib is a huge repository of incredibly valuable and robust scientific algorithms written in C and Fortran. It would be silly to rewrite these algorithms and would take years to debug them. SciPy uses a variety of methods to generate “wrappers” around these algorithms so that they can be used in Python. Some wrappers were generated by hand coding them in C. The rest were generated using either SWIG or f2py. Some of the newer contributions to SciPy are either written entirely or wrapped with Cython.

A second answer is that for difficult problems, a better algorithm can make a tremendous difference in the time it takes to solve a problem. So using scipy’s built-in algorithms may be much faster than a simple algorithm coded in C.

http://www.scipy.org/scipylib/faq.html#how-can-scipy-be-fast...

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by semi-extrinsic on Thursday October 29, 2015 @04:37PM (#10474098)
This is also why the scipy/numpy crowd doesn't care much about PyPy. In this world Python is the equivalent of ducttape. You don't performance optimize ducttape, you want it to be easy to use and to fix any problem you have.
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by camaraj on Thursday October 29, 2015 @09:37PM (#10475659)
PyPy is taking a similar approach. The difference is Numpy is using CPython's CAPI as the duct tape where as PyPy is using cffi as the duct tape. Both approaches end up using the same underlying libraries.

Too many people just have the wrong impression, thinking that PyPy plans on re-implementing all the libraries that Numpy and scipy use but that's just completely false.

They have re-implemented the Numpy array so that it can take advantage of the JIT and so that parts of an algorithm implemented In Python that uses Numpy can also be optimized. Unlike what occurs when using Numpy under CPython where the Python code does not get optimized unless it is converted to Cython, C Code, or some alternative to Python to have it be optimized.

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by rch on Thursday October 29, 2015 @04:59PM (#10474241)
I like the quote: "Python is generally the second-best language for everything".
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by pjmlp on Thursday October 29, 2015 @12:46PM (#10472396)
I don't understand numerical analysis as business applications.

For me business applications are what you would use Cobol, Clipper, Java, Delphi, C#, Eifel, ....

Of course Fortran makes sense for number crushing, but that is the language domain, not doing CRUD, ETL or distributed computing stuff (not counting MPI here).

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by nickpsecurity on Thursday October 29, 2015 @04:19PM (#10473981)
Accounting, spreadsheets, transaction processing, business intelligence?
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by pjmlp on Friday October 30, 2015 @03:46AM (#10476570)
Of course those are business applications as well.

Do you intend to refer to a product done in those areas Fortran in modern days, maybe with Fortran 2008?

Outside scientific computing and heavy number crushing algorithms and libraries, I don't see a use for it.

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by nickpsecurity on Friday October 30, 2015 @01:08PM (#10479037)
No, I'm just saying they're business applications. A segment of business applications are numerically focused. Fortran handles them well. So, in that segment, it can be considered a language for business applications with numeric focus.

I'm not saying anyone should use it today lol. Julia and R are the best for that sort of stuff. Way the hell ahead of Fortran. Although I thought about making a nice web application in Fortran just to screw with people who eventually try to extend it and gasp in horror. ;)

http://www.aim.env.uea.ac.uk/aim/info/fortran.pdf

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by jahewson on Thursday October 29, 2015 @12:48PM (#10472419)
R != Business Application.
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by baldfat on Thursday October 29, 2015 @01:53PM (#10472931)
Used R as an example of a language that still uses FORTRAN. BUT I think Microsoft and Business Analysis people would not agree with you.
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by dr_zoidberg on Thursday October 29, 2015 @09:47AM (#10470920)
I think you guys are saying the same thing. Ie, because they don't need to switch languages, and PyPy is a JIT engine for Python, these tons of Python code would benefit from if the devs were aware of PyPy.
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by lqdc13 on Thursday October 29, 2015 @03:57PM (#10473833)
Devs are already aware of PyPy. If it was as easy as being aware, everyone would switch tomorrow. The problem is that tons of code uses C extensions created with swig or python boost and those take a lot of time to port to PyPy. Another problem is that PyPy is sometimes slower/less memory efficient than CPython when you wrote the code that is optimized for CPython. That is abusing dictionaries and very limited OO use.
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by camaraj on Thursday October 29, 2015 @10:07PM (#10475752)
PyPy has higher memory overhead for very small units of work but usually once you do more than a couple of seconds of work it usually uses significantly less memory than CPython. As far as I'm concern who cares if a Hello World program uses more memory or some small trivial few lines of code. I'm more interested in real world code which my experience has been that PyPy uses significantly less memory than CPython. If you know of a case where this is not true report it as I'm sure the PyPy devs will consider it a bug.

PyPy also has a slower startup time/overhead so very small amounts of work may end up slower than CPython but in general larger chunks of work will be faster if not its a bug and should be reported.

There is currently some work going on to improve the C extension issue. It's currently in its beginning stages and its goals are to provide both a significant amount of compatibility with existing extensions and a significant reduction in the overhead to call out to C extensions over what is currently implemented in PyPy. On the performance side the new approach was said to remove about 40% of the existing overhead. There are tons of corner cases that still need to be worked on for the new approach to become production worthy and there is no guarantee that there will be no show stoppers that come up or that the tail of corner cases that need to be dealt with becomes a nightmare and the approach is abandoned. If this works succeeds, it will be a game changer as suddenly the majority of libraries would then become compatible with PyPy.

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by wyldfire on Thursday October 29, 2015 @10:34AM (#10471274)
Indeed that's what I meant and perhaps pjmlp thinks that the feature set in numpy could have been / could be implemented in pure python, now that we have PyPy.
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by pjmlp on Thursday October 29, 2015 @11:00AM (#10471504)
What I mean is that I see PyPy very positive, as a way to stay in Python instead of jumping into C, Go or whatever language.

In terms of performance naysayers only get convinced when someone proves them wrong, not because of what we think might be possible.

So it is important that we have research in GC systems, JIT compilers for dynamic languages, optimizers for FP and LP languages and so on.

Otherwise we might as well keep on using just Assembly.

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by lqdc13 on Thursday October 29, 2015 @03:51PM (#10473785)
Numpy is way faster than what you would get if you implementing things in pure Python and executed with PyPy. That's why there is numpypy in the first place.
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by fijal on Thursday October 29, 2015 @09:18AM (#10470722)
we're trying to address both numpy and C extensions, stay tuned ;-)
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by sandGorgon on Thursday October 29, 2015 @10:40AM (#10471328)
you should kickstarter this - and also the python 3 support.
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by fijal on Thursday October 29, 2015 @11:19AM (#10471711)
we did kickstart the python 3 support on our website. Donate!
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by 885895 on Thursday October 29, 2015 @04:00PM (#10473858)
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by wyldfire on Thursday October 29, 2015 @10:34AM (#10471279)
Keep up the good work!
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by StavrosK on Thursday October 29, 2015 @01:00PM (#10472499)
Is PyPy going to support Python 3? We kind of need the ecosystem to move forward, and Python 3 has a lot of niceties...
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by getup8 on Thursday October 29, 2015 @02:09PM (#10473064)
Doesn't it already? 3.2.5 it seems.

http://pypy.org/download.html

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by ris on Thursday October 29, 2015 @01:14PM (#10472607)
Yes - it's getting there and you can help it get there sooner by donating http://pypy.org/py3donate.html
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by cfontes on Thursday October 29, 2015 @11:54AM (#10472001)
I am a Java dev, I heard of PyPy a few years ago, I find it amazing and often tell people about it when talking about performance and other related topics.

The thing is I've never found another developer that new about it, something is very wrong...

Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by chrisseaton on Thursday October 29, 2015 @02:35PM (#10473242)
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by jegutman on Thursday October 29, 2015 @02:59PM (#10473405)
Also I recently discovered that pypy supports non-ASCII characters pretty well which at least doesn't work with my version of python 2.7.6
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by ptx on Thursday October 29, 2015 @03:27PM (#10473635)
In what way?
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by scardine on Thursday October 29, 2015 @05:18PM (#10474374)
In variable names, for example. You can do this:

    >>> π = 3.14
In Python 2:

    >>> π = 3.14
      File "<stdin>", line 1
        π = 3.14
        ^
    SyntaxError: invalid syntax
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by auscompgeek on Thursday October 29, 2015 @09:33PM (#10475654)

  Python 2.7.10 (850edf14b2c7, Oct 29 2015, 17:32:05)
  [PyPy 4.0.0 with GCC 5.2.0] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>>> π = 3.14
    File "<stdin>", line 1
      π = 3.14
      ^
  SyntaxError: Unknown character
Are you sure you weren't trying it in Python 3 (or PyPy3) rather than PyPy?
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by takeda on Friday October 30, 2015 @03:57PM (#10480160)
I'm getting same result as scardine:

    Python 2.7.8 (default, Sep 30 2014, 15:34:38) [GCC] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> π = 3.14
      File "<stdin>", line 1
        π = 3.14
        ^
    SyntaxError: invalid syntax
    >>> 
also:

    Python 3.4.1 (default, May 23 2014, 17:48:28) [GCC] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> π = 3.14
    >>> print(π)
    3.14
Re:PyPy 4.0.0 Released – A Jit with SIMD Vectorization and More by scardine on Monday November 02, 2015 @08:00PM (#10496648)
You are right, this is Python 3 stuff. I just assumed the parent was talking about Pypy3.