Stream: wit-bindgen

Topic: ✔ Passing uuid & others


view this post on Zulip ocxide (Nov 19 2024 at 20:22):

Hello, is there a way to pass types as uuid?
UUID is generally represented as an string but it is stored as a fixed-size array of numbers in some languages such as rust.

Would there be any perf gain by passing the UUID as a tuple? Is there a way to automatically convert the tuple back to an UUID in both ends (host/guest)?

Ideally, this would not only apply to UUID but to other types that host or guest are able to de-serialize from simple types.

view this post on Zulip Dan Gohman (Nov 19 2024 at 20:30):

At present string, list, or a tuple are the main options for doing this, though they'll all require a little extra conversion on both ends. There are discussions about adding bounded strings and lists in the future, which will improve on these.

This extends #181 with the ability to embed bounded strings or lists directly within other structures while maintaining the variable length property. Some environments require avoiding all memory a...

view this post on Zulip ocxide (Nov 19 2024 at 20:46):

I see there is no way of avoiding an extra layer of conversion for this types. A little internal wrapper library will do the work.
Thanks.

view this post on Zulip Notification Bot (Nov 19 2024 at 20:46):

ocxide has marked this topic as resolved.


Last updated: Dec 23 2024 at 13:07 UTC