
Let's Write an LLVM Specializer for Python - adamnemecek
http://dev.stephendiehl.com/numpile/
======
Loic
If this is of interest for you, I can only recommend you to check out numba:
[http://numba.pydata.org/](http://numba.pydata.org/)

"Numba works by generating optimized machine code using the LLVM compiler
infrastructure at import time, runtime, or statically (using the included pycc
tool). Numba supports compilation of Python to run on either CPU or GPU
hardware, and is designed to integrate with the Python scientific software
stack."

------
drewm1980
Pretty neat, at least as a learning tool for people interested in writing
their own transpilers!

Incidentally, I evaluated a few tools for going "one level lower" than numpy
just last week for a project at work.

Pypy was out since our codebase already migrated to python 3.

Numba failed to install on Ubuntu 14.04 via pip even after some prodding. I
don't want yet another python package manager on my system.

Cython is it's own language; not Python or C. I don't want yet another
language in my codebase.

For our codebase I decided to go with numpy's ctypes integration; a good
example is way at the bottom of:

[http://scipy.github.io/old-
wiki/pages/Cookbook/Ctypes](http://scipy.github.io/old-
wiki/pages/Cookbook/Ctypes)

For our (already mixed) python/numpy/C++ project, the incremental cost was
just a few lines of boilerplate per function to make up for both languages
(and ultimately the linker) lacking a proper language-level nd-array type.

For our project there were no new dependencies, and as a bonus, after heavily
testing and benchmarking your .so file from python, it's still callable from
anything with a C FFI.

~~~
plesiv
> I don't want yet another python package manager on my system.

Use virtualenv. Having python specific packaging system makes sense with
virtual environments. Tracking dependencies with requirements.txt and
installing them with portable package manager makes build of a project
portable. There are limitations to the current state of pip, but the idea
behind it is sound.

~~~
chaosphere2112
VirtualEnv and conda both accomplish the same goal (though conda has a fairly
clever pip alternative included), but for vastly different userbases.

I am a developer, I've used VirtualEnv for every web app I've worked on, but
now I use conda for handling my environments/package management because our
software was ported over to it.

The reasons we did that were:

a) Every one of our users knows how to use conda (we build a scientific
visualization app)

b) it got rid of a few thousand lines of CMake

c) Installation time is now maybe five minutes instead of 1+ hours.

d) We don't lose a week trying to get our stuff installed on a supercomputer

Our users are all scientists. They don't care about "best practices", they
just want their stuff to work, and to be able to do their job. The level of
technical skill varies wildly, but now a tool exists and they actually use it
to segregate versions of their packages into separate environments. This is a
freaking miracle; trying to figure out what's broken on a person in india's
computer when they did a crazy from-source install in an environment we barely
support was just about impossible. Now we say "do conda list and send us the
output; also, you can get a working environment by installing whatever
previous version worked for you" is a huge change (yes, build systems and
package managers have been fixing that problem for decades, but this was the
first one compelling enough to actually get scientists on board).

conda has been fantastic for us, and our users love it. They don't give a crap
about what the python community has deemed the "right" way to do something.

------
tartavull
I liked it so much that I tried to make a package out of it
[https://github.com/tartavull/fastpy](https://github.com/tartavull/fastpy)

------
dschiptsov
Like that Haskell compiler from the first principles?

~~~
DanWaterworth
Same author:
[http://dev.stephendiehl.com/fun/](http://dev.stephendiehl.com/fun/)

~~~
dschiptsov
Now look at the page and notice that it is abandoned, unfinished.

~~~
cowsandmilk
> it is abandoned

Last github commit 13 days ago == "abandoned"??

------
bjd2385
This is neat. I can't wait to give it a try

