karamel icon indicating copy to clipboard operation
karamel copied to clipboard

Rust: support for interface bundles?

Open tahina-pro opened this issue 10 months ago • 3 comments

Thanks a lot @R1kM and @msprotz for #533 !

Based on that, I have a feature request. Consider the following two interfaces:

module AuxA
val foo: bool -> bool

module AuxB
val bar: bool -> bool

I can implement those two interfaces and extract a single Rust file with -bundle AuxA+AuxB=[rename=Aux,rename-prefix]. Karamel produces a single aux.rs file, as I expect.

However, at this point, if I write a client for those interfaces and extract it to Rust with that bundle, it will still produce calls to auxa::foo and auxb::bar instead of aux::foo and aux::bar (see be223e471206fa0ae2a3ccbafe331af63b60adfa).

Would it be possible to have Karamel Rust backend support such interface bundles? Thanks in advance!

tahina-pro avatar Feb 19 '25 03:02 tahina-pro

Thanks for the report, this looks like something we can look into

msprotz avatar Feb 19 '25 18:02 msprotz

Pushed a commit to fix this on your branch. Please review! Cheers

msprotz avatar Feb 20 '25 21:02 msprotz

@tahina-pro ping? did this end up being merged?

msprotz avatar Mar 07 '25 18:03 msprotz