Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: serge guelton Newsgroups: comp.lang.python.announce Subject: Pythran 0.7.4 is out! Date: Thu, 7 Jan 2016 20:51:39 +0100 Lines: 92 Approved: python-announce-list@python.org Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+HP7ph2BbKc20aGI" X-Trace: news.uni-berlin.de cJpV352JkDk2DhzJL/QnkQ2gcliuqhHEQGfNR4OkfvWQ== Return-Path: X-Original-To: python-announce-list@python.org Delivered-To: python-announce-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'cpython': 0.05; 'python3': 0.05; '[0]': 0.07; '(sorry': 0.09; 'any)': 0.09; 'cc:addr:googlegroups.com': 0.09; 'intrusive': 0.09; 'of)': 0.09; 'target,': 0.09; 'tends': 0.09; 'url:github': 0.09; 'python': 0.10; 'template': 0.11; ':-)': 0.12; 'output': 0.13; 'syntax': 0.13; 'def': 0.13; '*you*': 0.16; 'delighted': 0.16; 'filename:fname piece:signature': 0.16; 'idx,': 0.16; 'item)': 0.16; 'magic': 0.16; 'numpy': 0.16; 'posting,': 0.16; 'pythonic': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'to:addr:freelists.org': 0.16; 'compilation': 0.18; 'runs': 0.18; 'cc:addr:python.org': 0.20; 'cc:2**2': 0.20; 'work,': 0.21; 'simpler': 0.22; 'pass': 0.22; 'import': 0.24; '(most': 0.24; '(this': 0.24; 'testing': 0.25; 'install': 0.25; 'header:User- Agent:1': 0.26; 'compatible': 0.27; "skip:' 10": 0.28; 'motivation': 0.29; 'array': 0.29; 'code': 0.30; 'checks': 0.30; 'non': 0.32; '[1]': 0.32; 'announce': 0.32; 'compiled': 0.32; 'run': 0.33; 'url:python': 0.33; 'extract': 0.33; 'flags': 0.33; 'traditional': 0.33; 'c++': 0.35; 'generic': 0.35; 'level': 0.35; 'supports': 0.35; 'project': 0.36; 'url:org': 0.36; '(and': 0.36; 'faster': 0.36; 'thanks': 0.37; 'release': 0.37; 'charset:us- ascii': 0.37; 'version': 0.38; 'high': 0.60; 'total': 0.62; 'export': 0.63; 'improved': 0.63; 'more': 0.63; 'great': 0.63; 'it!': 0.64; 'continuous': 0.66; 'here': 0.66; 'laptop': 0.67; 'dear': 0.67; 'special': 0.73; 'boost.python': 0.84; 'construct': 0.84; 'received:195.154': 0.84; 'cc:no real name:2**2': 0.91 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sd-34863.dedibox.fr X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.1 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Mailman-Approved-At: Sat, 09 Jan 2016 09:51:38 -0500 X-BeenThere: python-announce-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: Announcement-only list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python.announce:1973 --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline (sorry for the double posting, if any) Dear pythraners and pythonists, The pythran team (a great total of 2 active developers) is delighted to announce the release of Pythran 0.7.4, available on the traditional channels: - pypi: https://pypi.python.org/pypi/pythran - conda: https://anaconda.org/serge-sans-paille/pythran - github: https://github.com/serge-sans-paille/pythran As usual, here is a (new) code sample, once again adapted from a stackoverflow question[0] that showcases pythran capability: #pythran export check_mask(bool[][], bool[]) # ^~~~~~~ non intrusive top-level annotation import numpy as np # ^~~~~~ numpy support (partial) def check_mask(db, out, mask=[1, 0, 1]): for idx, line in enumerate(db): target, vector = line[0], line[1:] # ^~~~~ type destructuring, array view if (mask == np.bitwise_and(mask, vector)).all(): # ^~~~~~~ optimization of high level construct if target == 1: out[idx] = 1 return out Compiled with: % pythran check_mask.py And benchmarked with: % python -m timeit -s 'n=10e3 ; import numpy as np;db = np.array(np.random.randint(2, size=(n, 4)), dtype=bool); out = np.zeros(int(n),dtype=bool); from eq import check_mask' 'check_mask(db, out)' On average, the CPython version runs in 137 msec while the pythran version run in 450us on my laptop :-) Here is an extract of the changelog: 2016-01-05 Serge Guelton * IPython's magic for pythran now supports extra compile flags * Pythran's C++ output is compatible with Python3 and pythran3 can compile it! * More syntax checks (and less template traceback) * Improved UI (multiline pythran exports, better setup.py...) * Pythonic leaning / bugfixing (this tends to be a permanent item) * More generic support for numpy's dtype * Simpler install (no more boost.python deps, nor nt2 configuration) * Faster compilation (no more boost.python deps, smarter pass manager) * Better testing (gcc + clang) Again, thanks a lot to Pierrick for his continuous top-quality work, and to the OpenDreamKit[1] project that funded (most of) the recent developments! Special thanks to @hainm, @nbecker, @pkoch, @fsteinmetz, @Suor for their feedbacks. *You* give us the motivation to go on! [0] http://stackoverflow.com/questions/34500913/numba-slower-for-numpy-bitwise-and-on-boolean-arrays [1] http://opendreamkit.org/ --+HP7ph2BbKc20aGI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlaOwcsACgkQLjaibHrvX+Z+oQCcDkckm2ubrz7zV11qMPOyJqnW lOEAn1zVCH+ynJo1oV8zUz3O3oXNck4c =G0Jj -----END PGP SIGNATURE----- --+HP7ph2BbKc20aGI--