Uh oh!
There was an error while loading. Please reload this page.
Get C strings passing from Python to C - #671
Conversation
czgdp1807
commented
Jun 22, 2022
Well I can try for LPython. Don't know if we should expect it to work for CPython. The reason being, CPython doesn't compile, rather it interprets so linking object files never comes into the picture. |
czgdp1807
commented
Jun 22, 2022
I am opening a new PR for this. Will add you as a co-author there. |
certik
commented
Jun 22, 2022
CPython calls into linked C codes, that already works, see our tests in It works for ints, pointers, etc. But not strings yet, that's what we need to get working. I am doing CPython first, so that we know what syntax will work, and then we implement it in LPython. It works in LFortran already, so ASR and backends have the feature, but we need to hook it up in AST->ASR. |
czgdp1807
commented
Jun 22, 2022
Well if you want to continue here, then please feel free to do so. |
czgdp1807
commented
Jun 22, 2022
Note that LPython already compiles the new test (with strings) and hence everything is already working there. What needs to be done is to make CPython work. |
certik
commented
Jun 22, 2022
Yes, CPython is the hard work here. :) |
certik
commented
Jun 22, 2022
Closing this in favor of #674. |
In all CPython, LLVM, C backends, we need some way to pass strings into a function implemented in C.
I got stuck doing it in CPython already, I can't figure out a natural way to do it.
There might be a way via CPtr.