You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What should be the recommended usage? It seems to me the second case is incorrect, as PointerToCPtr should only accepts pointers as the first argument?
The other issue is: we need to also have a CPython implementation of whatever syntax/semantics we choose. If it cannot be done for the above syntax, then we need to change it.
I see. So just importing stuff from ctypes into ltypes will allow CPython to at least run the code. However, I am wondering can CPython really call into C code. Like AFAIK, LPython generates an object file and that's linked to the object file of .c file (where we implement the C functions called in Python code). Now since CPython never generates an object file then how will the C functions linked to their definition.
Yes, so callbacks cannot be done from CPython, I also just realized that, so we will simply not implement @ccallable in CPython. But calling into C is possible, and it works already. So all other features we'll get working.
Activity
czgdp1807 commentedon Jun 14, 2022
We can use
ctypesto run the code withCPython?certik commentedon Jun 14, 2022
Yes, we already do in
ltypes.py.czgdp1807 commentedon Jun 14, 2022
I see. So just importing stuff from
ctypesintoltypeswill allow CPython to at least run the code. However, I am wondering can CPython really call into C code. Like AFAIK, LPython generates an object file and that's linked to the object file of.cfile (where we implement the C functions called in Python code). Now since CPython never generates an object file then how will the C functions linked to their definition.certik commentedon Jun 14, 2022
Yes, so callbacks cannot be done from CPython, I also just realized that, so we will simply not implement
@ccallablein CPython. But calling into C is possible, and it works already. So all other features we'll get working.