[LLVMdev] Python bindings in tree

Anders Waldenborg anders at 0x63.nu
Wed Mar 21 04:47:40 PDT 2012


On Tue, Mar 20, 2012 at 10:07:14PM -0700, Gregory Szorc wrote:
> automatic is the way to go (just as long as the automatically generated
> code is easy to diff when they are regenerated).

Yes it should be easy to diff. My generated code is in the same order
as in the llvm-c/*.h files.

> Yeah, Module is an example where the number of named arguments is pretty
> overwhelming. I was probably going to create static methods for Module
> creation. Whether I was going to leave the named arguments on the
> constructor is an open issue. I don't think it matters too much.

I don't think it matters that much either. BUT I think consistency
matters, so it should be decided upon before the API grows. Just
having static methods resonates well with the "only one" part of
"There should be one - and preferably only one - obvious way to do
it.", the question is how obvious it is..

(I think that the internals of the bindings can be simpler if all
initializers just takes a pointer. But if the choice is between
cleaner API or cleaner internals the choice is easy.)

> I'm not too concerned about this consistency. llvm-py began many years ago.
> Assumptions may be different now. I think we should do what makes sense
> today. If that is the same great. If not, oh well.

I totally agree.

> >  I do like having the tests outside the dir.
> >
> 
> I have no major opinion on this.

Me neither. It was mostly an obvervation. As long as the tests doesn't
do relative imports so they easily can be run againts another version.

There was another (minor) difference. All testcases in my bindings
were written as functions (i.e no containing UnitTest class), as
nosetests picks them up just fine. I'd don't mind changing them to
UnitTest when/if I port them over.

> In related news, I see you have received commit access, Anders.
> Congratulations!

Yay! I even managed to commit some stuff!

> We just need to figure out this review/module owner
> situation...

Yeah. I'm not even sure where we stand today. 

It is quite messy to keep track of everything with the official stuff
in the svn repo, your pythonbindings git repo and my local stuff. I'm
not sure what to do. I guess trying to make sure there is as little
code floating around outside of the official svn repo is good goal.

 anders



More information about the llvm-dev mailing list