Get C strings passing from Python to C#671
Conversation
|
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. |
|
I am opening a new PR for this. Will add you as a co-author there. |
|
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. |
|
Well if you want to continue here, then please feel free to do so. |
|
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. |
|
Yes, CPython is the hard work here. :) |
|
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.