We want to be able to represent an equivalent of the following code in Python and generate the same C code using the C backend:
structA {
int32_tx;
floaty;
};
voidf(structA*a) {
int32_tx=a->x;
floaty=a->y;
...
}Here is one approach how the Python code could look like:
@dataclassclassA:
x: i32y: f32@ccallabledeff(a: CPtr) ->None:
x: i32y: f32a2: Pointer[A]
c_p_pointer(a, a2)
x=a2.xy=a2.y
It looks like two prerequisites are needed before we can tackle this:
We want to be able to represent an equivalent of the following code in Python and generate the same C code using the C backend:
Here is one approach how the Python code could look like:
It looks like two prerequisites are needed before we can tackle this: