The current app! macro implements the functions defined in the udl file. This is clunky because we always have to define each function even if we're not compiling support for said functions. The macro itself is also primitive and unhygienic and prevents the user from exposing additional custom functions over the ffi.
Details
To solve this we can switch to use macros like #[uniffi::export] to expose functions directly from the rust code. We can expose our own macros that wrap these functions like export_circom!.
Acceptance criteria
This issue only includes switching the existing code from static udl file to macros. This includes updating the build system so that the ios/android build commands handle generating the swift/kotlin bindings.
The mopro.udl file should be removed along with the committed bindings.
Next steps (optional)
After this issue is complete halo2 integration should be easier/more robust and we can allow the user to define their own functions that are exposed over ffi.
Problem
The current
app!
macro implements the functions defined in the udl file. This is clunky because we always have to define each function even if we're not compiling support for said functions. The macro itself is also primitive and unhygienic and prevents the user from exposing additional custom functions over the ffi.Details
To solve this we can switch to use macros like
#[uniffi::export]
to expose functions directly from the rust code. We can expose our own macros that wrap these functions likeexport_circom!
.Acceptance criteria
This issue only includes switching the existing code from static udl file to macros. This includes updating the build system so that the ios/android build commands handle generating the swift/kotlin bindings.
The
mopro.udl
file should be removed along with the committed bindings.Next steps (optional)
After this issue is complete halo2 integration should be easier/more robust and we can allow the user to define their own functions that are exposed over ffi.