Open James-E-A opened 10 months ago
As of version 0.0.0.9, we've ditched the cdef_extern and switched over just to compiling the sources inline.
I looked into SWIG as an alternative (it would allow actually dynamically linking the common deps, and would also allow us to avoid the extra unnecessary copy when converting a mutable FFI allocation into a bytes
for return by constructing the object in-place, which would be AWESOME), but *golly* their tooling is just awful; I couldn't figure it out
As it stands, the "hard-coded"
def_extern()
calls at import-time are messy and awkward.It looks like maybe "out-of-line ABI mode" could be used for a cleaner, more modularized solution.
Something like this might work: