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
oberstet has quit [Quit: Leaving]
lritter has quit [Quit: Leaving]
jcea has quit [Ping timeout: 240 seconds]
forgottenone has joined #pypy
EWDurbin has quit [Ping timeout: 246 seconds]
DRMacIver has quit [Read error: Connection reset by peer]
DRMacIver has joined #pypy
EWDurbin has joined #pypy
graingert has quit [Ping timeout: 264 seconds]
graingert has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]
astronavt___ is now known as astronavt
Techcable has quit [Remote host closed the connection]
_whitelogger has joined #pypy
tsaka__ has joined #pypy
todda7 has quit [Ping timeout: 265 seconds]
todda7 has joined #pypy
tsaka__ has quit [Read error: Connection reset by peer]
todda7 has quit [Ping timeout: 240 seconds]
tsaka__ has joined #pypy
rubdos has quit [*.net *.split]
energizer has quit [*.net *.split]
kirma has quit [*.net *.split]
energizer has joined #pypy
rubdos has joined #pypy
kirma has joined #pypy
rubdos has quit [Max SendQ exceeded]
rubdos has joined #pypy
astrojl_matrix has quit [Ping timeout: 240 seconds]
papangoo[m]1 has quit [Ping timeout: 240 seconds]
jevinskie[m] has quit [Ping timeout: 240 seconds]
toad_polo has quit [Ping timeout: 250 seconds]
jryans has quit [Ping timeout: 246 seconds]
ShadeJonathan[m] has quit [Ping timeout: 244 seconds]
astrojl_matrix has joined #pypy
proteusguy has quit [Remote host closed the connection]
jryans has joined #pypy
jevinskie[m] has joined #pypy
ShadeJonathan[m] has joined #pypy
toad_polo has joined #pypy
papangoo[m]1 has joined #pypy
jcea has joined #pypy
proteusguy has joined #pypy
jaraco has quit [Remote host closed the connection]
michelp has quit [Remote host closed the connection]
EWDurbin has quit [Remote host closed the connection]
graingert has quit [Remote host closed the connection]
DRMacIver has quit [Remote host closed the connection]
cfbolz has quit [Remote host closed the connection]
DRMacIver has joined #pypy
cfbolz has joined #pypy
cfbolz has quit [Remote host closed the connection]
DRMacIver has quit [Remote host closed the connection]
DRMacIver has joined #pypy
cfbolz has joined #pypy
EWDurbin has joined #pypy
michelp has joined #pypy
graingert has joined #pypy
jaraco has joined #pypy
todda7 has joined #pypy
tsaka__ has quit [Ping timeout: 265 seconds]
lritter has joined #pypy
Dejan has quit [Quit: Leaving]
tsaka__ has joined #pypy
todda7 has quit [Ping timeout: 272 seconds]
tsaka__ has quit [Ping timeout: 246 seconds]
todda7 has joined #pypy
Dejan has joined #pypy
forgottenone has joined #pypy
muke has joined #pypy
<muke> hey, I have a couple questions about using the rffi
<muke> there are some functions in the LLVM API that require you stack allocate a pointer which you then pass a referance for it to write a result into, is this possible with the rffi without using malloc? If not I'm thinking using a wrapper might be easiest
<muke> Also, is there an existing way of using enums with the low level types? I've typedef'ed enums to signed ints for now which works fine for passing them around, but if I need to intiailize one myself is that possible or again should I be looking at a wrapper?
<arigo> muke: these two features are not really supported by rffi, indeed, so wrappers look good
<muke> right I had thought so, thanks for confirming
<arigo> not sure what you mean by "initialize one yourself"?
<muke> lastly, the way llvm expects you to execute compiled code (without writing to disk) is to retrieve the address of a symbol then cast it to the right type of function pointer, is that at all possible?
<muke> well I have a function which takes an enum defined in the library, I'm not sure how to initialize that argument myself from within rpython before calling the function
<arigo> enum values are just constants, in C
<muke> Is there a reliable way to find which numerical value they each map to though? Sorry this is probably more of a C specific question
<arigo> yes, like for other constants
<muke> ok I'll do some research into that, that should be fine then
<arigo> in C you write "enum foo { A, B, C }" but really the names "A", "B" and "C" are global constants, and there is support in rffi to get their value without hard-coding it
<muke> ahh, ok that's what I was wondering about
<arigo> and to cast a raw address to a function pointer, yes, use rffi.cast(). the function pointer type must be known at translation time
<arigo> e.g. lltype.Ptr(lltype.Func(...))
<muke> cool, I had seen that function but wasn't sure if it would have support for a more elaborate use like that
<muke> thanks for the info
<arigo> :-)
<cfbolz> muke: look for DefinedConstantInteger
<muke> cfbolz so I just pass the enum type name as the 'macro' argument and the rffi handles the rest?
dansan_ has joined #pypy
tsaka__ has joined #pypy
mattip_ has joined #pypy
<cfbolz> muke: think so
lritter has quit [*.net *.split]
todda7 has quit [*.net *.split]
marvin_ has quit [*.net *.split]
dansan has quit [*.net *.split]
mattip has quit [*.net *.split]
lritter has joined #pypy
marvin_ has joined #pypy
mattip has joined #pypy
lritter has quit [Excess Flood]
ulope has quit [Ping timeout: 264 seconds]
nulano has quit [Ping timeout: 246 seconds]
mattip has quit [Ping timeout: 254 seconds]
stillinbeta has quit [Ping timeout: 246 seconds]
ulope has joined #pypy
nulano has joined #pypy
stillinbeta has joined #pypy
astrojl_matrix has quit [Ping timeout: 244 seconds]
toad_polo has quit [Ping timeout: 244 seconds]
lritter has joined #pypy
toad_polo has joined #pypy
astrojl_matrix has joined #pypy
<arigo> muke: DefinedConstantInteger takes the individual name of the constant, you don't specify the enum type at all
<muke> arigo sorry yea that's what I meant - if you had enum foo {A, B, C} you'd pass A and that'd be enough, right?
<arigo> yes
<muke> great
Techcable has joined #pypy
lritter has quit [*.net *.split]
nulano has quit [*.net *.split]
energizer has quit [*.net *.split]
dustinm- has quit [*.net *.split]
ebarrett has quit [*.net *.split]
commandoline has quit [*.net *.split]
whitewolf has quit [*.net *.split]
gutworth has quit [*.net *.split]
WGH has quit [*.net *.split]
Ninpo has quit [*.net *.split]
ammar2 has quit [*.net *.split]
alcarithemad has quit [*.net *.split]
lritter has joined #pypy
ebarrett has joined #pypy
nulano has joined #pypy
gutworth has joined #pypy
Ninpo has joined #pypy
WGH has joined #pypy
alcarithemad has joined #pypy
ammar2 has joined #pypy
commandoline has joined #pypy
energizer has joined #pypy
whitewolf has joined #pypy
dustinm- has joined #pypy
Techcable has quit [Remote host closed the connection]
Techcable has joined #pypy
marky1991 has joined #pypy
muke has quit [Quit: Leaving]
oberstet has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]