r/learnrust • u/More-Client1910 • 10h ago
Uniffi - proc-macros vs UDL
For those of you using UniFFI, which approach do you prefer: proc-macros or UDL?
I've been reading the documentation, and I understand that UDL is useful when you want to separate the interface definition from the Rust implementation.
But I'm not quite sure what the actual benefit is in practice.
Is it mainly about keeping the FFI interface separate from the Rust code, or is there another advantage?
For example, with proc-macros, we use #[uniffi::export] to expose functions. With UDL, we define the interface separately and don't need those annotations for the exported functions.
Am I understanding this correctly?
I'd love to hear why you chose one approach over the other and what you recommend!
