Hi, Are there Python bindings for LLVM? Apparently there was one ~2005; has this been updated since? Is anyone working on this? Is the LLVM dev community interested in this? Thanks & Regards, -Mahadevan.
Mahadevan R wrote:> Hi, > > Are there Python bindings for LLVM? > > Apparently there was one ~2005; has this been updated since? Is anyone > working on this? > > Is the LLVM dev community interested in this? >I'm curious. What would you use this for?
HI Nick,> > Are there Python bindings for LLVM? > > I'm curious. What would you use this for?Mainly because it'd be easier to play around with the LLVM APIs, to create toy languages like the Kaleidoscope (from the tutorial). For the LLVM development itself, perhaps it can also be used to create unit/regression test scripts. Its also a good way to learn LLVM ;-) Regards, -Mahadevan.
On Mar 26, 2008, at 06:39, Mahadevan R wrote:> Are there Python bindings for LLVM?I'm not aware of any. The PyPy compiler pipes LLVM assembly to llc rather than building the C++ IR in memory.> Apparently there was one ~2005; has this been updated since? Is > anyone working on this? > > Is the LLVM dev community interested in this?Yes! Note that C bindings have been introduced since 2005, so there may be a different route available than was taken then. Look in include/llvm- c. The intent of the C bindings is to enable high-level language bindings. The current focus is on enabling front-end compilers. Ocaml and Haskell bindings have been developed atop them, the former being in the LLVM source tree. — Gordon
> Note that C bindings have been introduced since 2005, so there may be > a different route available than was taken then. Look in include/llvm- > c. The intent of the C bindings is to enable high-level language > bindings. The current focus is on enabling front-end compilers. Ocaml > and Haskell bindings have been developed atop them, the former being > in the LLVM source tree.1) Are the C bindings complete? That is, is there some part of the C++ API that is not exposed by the C API? 2) Do the Ocaml/Haskell bindings follow that language's naming conventions? Or LLVM's? For e.g., in Python method names are usually like_this. So which of these are preferred: Builder.set_insert_point() or Builder.SetInsertPoint() ? Regards, -MD.