
Llvmcpy – Python bindings for LLVM auto-generated from the LLVM-C API - aleclm
https://rev.ng/llvmcpy
======
bmh100
Please forgive my ignorance, but how would this be useful? I am not familiar
with compilers or what having bindings in Python to a compiler would help.

~~~
thomaslee
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
More on what Thomas said:

[http://www.llvmpy.org/](http://www.llvmpy.org/)

~~~
bootload
_" 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)

------
yjftsjthsd-h
Didn't see in the readme: why "final"? I could see it being considered
complete or failed, but it's unclear.

~~~
connerbryan
I believe it's because llvmlite is now suggested.

The llvmpy page mentions:

> Warning

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

[http://llvmlite.pydata.org/en/latest/](http://llvmlite.pydata.org/en/latest/)

~~~
jholman
Why is this relevant? Are llvmpy and llvmcpy related?

~~~
connerbryan
Oh, my bad. You're right, I got my links mixed up.

aleclm has responded with the correct answer, ignore mine.

------
witty_username
How does this compare to llvmlite?

Is this going to support a larger portion of the LLVM API?

~~~
eliben
It looks to be a less complete solution, since it only relies on the LLVM C
API which is incomplete. llvmlite digs into the C++ API as well, so while it
has more work to do to keep up with changes in LLVM, it's more more feature-
complete

~~~
aleclm
The LLVM-C API is quite powerful, and I'm planning to upstream some patch to
expose additional stuff. On the other hand, llvmlite doesn't even parse
existing IR, it's basically write-only. Plus, representing the IR in Python
makes it less memory efficient than using the native representation.

