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
Currently, when adding a component, we need to manually create the FFI wrapper function and its associated bootstrap.json metadata. It'd be fantastic if this could be done automatically from the underlying Rust function in a build script. But this is hard!
There are a couple of ways that this might work:
Proc macros invoked directly on the functions in opendp to generate the wrappers. This has the downside of introducing (generated) unsafe code into core.
A build script in opendp-ffi that parses the functions in opendp to generate the wrappers. This would require a little more plumbing, but the code would be the same (presumably using the syn crate), and it avoids the unsafe issue.
One of the main stumbling blocks is wrappers requiring complex dispatch on type. The macros in dispatch.rs only handle one level of indirection, so this means implementing multiple nesting monomorphize() functions.
Currently, when adding a component, we need to manually create the FFI wrapper function and its associated bootstrap.json metadata. It'd be fantastic if this could be done automatically from the underlying Rust function in a build script. But this is hard!
There are a couple of ways that this might work:
opendp
to generate the wrappers. This has the downside of introducing (generated) unsafe code into core.opendp-ffi
that parses the functions inopendp
to generate the wrappers. This would require a little more plumbing, but the code would be the same (presumably using thesyn
crate), and it avoids the unsafe issue.One of the main stumbling blocks is wrappers requiring complex dispatch on type. The macros in
dispatch.rs
only handle one level of indirection, so this means implementing multiple nestingmonomorphize()
functions.An intermediate step towards this could be #42.
The text was updated successfully, but these errors were encountered: