Hacker News new | ask | show | jobs
by thomaslee 3478 days ago
You could, for example, write a compiler in Python that generated native code (or LLVM bitcode to be passed to llc or whatever) via the LLVM API. Writing a compiler in Python vs. C/C++ would be a lot easier in a number of ways.

I'm not aware of any "production grade" compilers that do this, but no hard reason why not, I guess. Seems like it'd be nice for prototyping etc. if nothing else.

3 comments

Check out numba. It does this for a subset of Python.
More on what Thomas said:

http://www.llvmpy.org/

"This project has been deprecated and is no longer being actively developed. We strongly suggest migrating to llvmlite. "

try http://llvmlite.pydata.org/en/latest/ explanation why http://llvmlite.pydata.org/en/latest/intro/index.html

So could I use this to conveniently optimize frequently called or inner loop functions?