Hi, I would like to share my experimental LLVM API Python bindings with the LLVM enthusiasts. I have created Boost.Python wrappers largely for the VMCore interface and other selected interfaces (e.g. ExecutionEngine). The bindings provide direct runtime access to the LLVM bytecode and JIT execution features from Python. The bindings are complete enough so that one can e.g. run the Fibonacci JIT demo in Python (see fibonacci.py in the package). Other than this, the bindings have seen very little testing: caveat emptor! Quick start: - make sure you have Python and Boost.Python installed - extract Python.tgz (attached) into $LLVM/lib/Python - cd $LLVM/lib/Python - make - export PYTHONPATH=$PYTHONPATH:$LLVM/Debug/bin - python fibonacci.py More details are provided in the README.txt within Python.tgz. BR, Jarno -- Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail -------------- next part -------------- A non-text attachment was scrubbed... Name: Python.tgz Type: application/x-compressed-tar Size: 40059 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050224/4caf5d9a/attachment.bin>
Jarno, This looks like it could be very valuable - thanks for making it available. Just out of curiosity, do you have any specific uses in mind for which you created these bindings? --Vikram http://www.cs.uiuc.edu/~vadve http://llvm.cs.uiuc.edu/ On Feb 23, 2005, at 5:21 PM, Jarno Seppänen wrote:> Hi, > > I would like to share my experimental LLVM API Python bindings with > the LLVM > enthusiasts. I have created Boost.Python wrappers largely for the > VMCore > interface and other selected interfaces (e.g. ExecutionEngine). The > bindings provide direct runtime access to the LLVM bytecode and JIT > execution features from Python. > > The bindings are complete enough so that one can e.g. run the > Fibonacci JIT > demo in Python (see fibonacci.py in the package). Other than this, the > bindings have seen very little testing: caveat emptor! > > Quick start: > - make sure you have Python and Boost.Python installed > - extract Python.tgz (attached) into $LLVM/lib/Python > - cd $LLVM/lib/Python > - make > - export PYTHONPATH=$PYTHONPATH:$LLVM/Debug/bin > - python fibonacci.py > > More details are provided in the README.txt within Python.tgz. > > BR, Jarno > > -- > Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS > GMX bietet bis zu 100 FreeSMS/Monat: > http://www.gmx.net/de/go/ > mail<Python.tgz>_______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
Hi, Vikram wrote:> This looks like it could be very valuable - thanks for making it > available. Just out of curiosity, do you have any specific uses in > mind for which you created these bindings?Well, obviously the Python interface can be used to experiment with the JITter in Python. I was thinking that you could even write passes in Python someday -- I had some success with hello_pass.py (also included). As to the motivation for writing the bindings, I simply chose that as a means to teach myself about the LLVM API and also about Boost.Python. However, I noticed that this is no gentle learning approach since the API must be understood quite thoroughly in order to be able to create Python bindings that don't crash due to memory ownership problems. Fortunately Boost.Python allows sophisticated annotation of ownership policies on a function-by-function basis. Cheers, Jarno> On Feb 23, 2005, at 5:21 PM, Jarno Seppänen wrote: > > > Hi, > > > > I would like to share my experimental LLVM API Python bindings with > > the LLVM > > enthusiasts. I have created Boost.Python wrappers largely for the > > VMCore > > interface and other selected interfaces (e.g. ExecutionEngine). The > > bindings provide direct runtime access to the LLVM bytecode and JIT > > execution features from Python. > > > > The bindings are complete enough so that one can e.g. run the > > Fibonacci JIT > > demo in Python (see fibonacci.py in the package). Other than this, the > > bindings have seen very little testing: caveat emptor! > > > > Quick start: > > - make sure you have Python and Boost.Python installed > > - extract Python.tgz (attached) into $LLVM/lib/Python > > - cd $LLVM/lib/Python > > - make > > - export PYTHONPATH=$PYTHONPATH:$LLVM/Debug/bin > > - python fibonacci.py > > > > More details are provided in the README.txt within Python.tgz. > > > > BR, Jarno > > > > -- > > Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS > > GMX bietet bis zu 100 FreeSMS/Monat: > > http://www.gmx.net/de/go/ > > mail<Python.tgz>_______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev >-- DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen! AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl