3 ms·
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 comp
by thomaslee 10y 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.
- Tempest1981 10y agoMore on what Thomas said: http://www.llvmpy.org/ http://www.llvmpy.org/
- bootload 10y ago"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/ http://llvmlite.pydata.org/en/latest/ explanation why http://llvmlite.pydata.org/en/latest/intro/index.html http://llvmlite.pydata.org/en/latest/intro/index.html
- grej 10y agoCheck out numba. It does this for a subset of Python.
- bmh100 10y agoSo could I use this to conveniently optimize frequently called or inner loop functions?