cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
<muke>
hi, is it alright to ask rpython specific questions here?
<simpson>
Yeah, definitely.
<muke>
great - I'm trying to use the foreign function interface to access an API which has functions which take and return struct arguments defined in the library, instead of just low level types. In order to use them with rpython's lltype interface, do I need to redefine each struct from it's primitive types manually?
<muke>
the C code above and the external function from rpython I'm trying to define below
<muke>
the function obviously returns type 'LLVMModuleRef' and I'm not sure what the best way to define that from rpython is
<muke>
other than going into the llvm-c header files myself and recreating the structs
<simpson>
Yeah, you do have to redefine each struct, but the good news is that you can choose to only define the members that you need; you don't have to define every member and do manual padding, because the C compiler figures that out for us.
ronan has quit [Read error: Connection reset by peer]
ronan has joined #pypy
<muke>
oh that's good to know
<muke>
but alright thanks, just wanted to make sure before diving into that
<simpson>
For the specific case of LLVM, I bet that the more frequent contributors have more specific recommendations.
<muke>
there's llvmlite but it's compatibility with python2 was removed a few months ago so looks like I have to implement this by hand
<fijal>
it occupies 50% of available disk space atm
oberstet has joined #pypy
muke has joined #pypy
<muke>
cfbolz Hey, a thought came to mind about the llvm backend - is there any reason you can't take the existing machine code generated from a collection of traces and use an existing tool to parse this to llvm-ir? Besides maybe speed concerns.
<cfbolz>
I don't think such a reverse engineering tool exists
<fijal>
mattip: there is still build_dir which is 4G
forgottenone has quit [Ping timeout: 240 seconds]
<mattip>
weird again. If I sum the files in build_dir/pypy-c-jit*/build/*, I get 400M. But du -s on that directory says 1322M
<mattip>
sudo du -sBM build_dir/pypy-c-jit-linux-aarch64/build/* |cut -dM -f1 |paste -sd+ | bc
<mattip>
gives 406
<mattip>
sudo du -sBM build_dir/pypy-c-jit-linux-aarch64/build |cut -dM -f1 |paste -sd+ | bc
<cfbolz>
mattip: that could be "bytes used" vs "size on disk"
<mattip>
gives 1322
<mattip>
same du parameters, just summing the subdirectories
<muke>
cfbolz sorry just wanted to make sure, did you see the link i sent?
<cfbolz>
muke: yes, sorry
<cfbolz>
it might be possible
<cfbolz>
but would definitely be a very different style of project
<muke>
no worries, and yea i'm sure, but i'd be happy to go down whichever path would work best, or expect to anyway
<cfbolz>
I have no idea how well these projects work, honestly
forgottenone has joined #pypy
<muke>
well i wouldn't mind getting to grips with llvm-ir anyway so for now i'll stick to that, and maybe later on i can try and benchmark some rough prototypes of each to see if there's any significant differences, i thought i would see what you thought though