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
As far as I can tell, the only types allowed to cross the ffi boundary by value are the builtin types or new shared types? This makes perfect sense from a safety perspective, but limits the usability of existing custom C++ ADTs across the boundary.
Would it be possible to make an extensible interface to define how new, custom C++ types should be handled? For example, some codebases have their own implementation of ref-counted pointers, which I don't currently see a good way to expose through cxx (although I may just be missing something). It would be nice to allow users to implement their own "builtin" types, perhaps by implementing a trait defining the new type, then providing C++ and Rust interfaces to it. I'm not familiar enough with the cxx codebase (yet) to know what the interface for extensions might have to look like, but I wanted to check and see if this was worth looking into further.
If a sufficiently generic type extension interface existed, it might be useful to rewrite the current builtin types to fit this interface and thus extract their implementation from the core of the code generators?
Sorry if this has been discussed elsewhere, I looked and didn't see anything.
The text was updated successfully, but these errors were encountered:
Makes sense, thanks. I might be able to take a pass at #164, as I'd like to get more familiar with the codebase, but I can't promise how soon. I'm pretty slammed with other stuff for the moment.
As far as I can tell, the only types allowed to cross the ffi boundary by value are the builtin types or new shared types? This makes perfect sense from a safety perspective, but limits the usability of existing custom C++ ADTs across the boundary.
Would it be possible to make an extensible interface to define how new, custom C++ types should be handled? For example, some codebases have their own implementation of ref-counted pointers, which I don't currently see a good way to expose through cxx (although I may just be missing something). It would be nice to allow users to implement their own "builtin" types, perhaps by implementing a trait defining the new type, then providing C++ and Rust interfaces to it. I'm not familiar enough with the cxx codebase (yet) to know what the interface for extensions might have to look like, but I wanted to check and see if this was worth looking into further.
If a sufficiently generic type extension interface existed, it might be useful to rewrite the current builtin types to fit this interface and thus extract their implementation from the core of the code generators?
Sorry if this has been discussed elsewhere, I looked and didn't see anything.
The text was updated successfully, but these errors were encountered: