Add convenience host functions for working with String
and Bytes
#1511
Replies: 3 comments 1 reply
-
All these functions are useful, the main ones of interest to me are the string<>bytes conversion host fns for efficient conversions between the two types that are essentially the same underlying type anyway. Today the only way to do that conversion is by copying to linear memory and either using an allocator to allocate that memory or buffering on some fixed memory. Without these things existing it is almost preferrable to use Bytes over String wherever possible. |
Beta Was this translation helpful? Give feedback.
-
Thanks for aggregating the existing requests. That makes it simple to build a case for the proposal. |
Beta Was this translation helpful? Give feedback.
-
Oh yes that would be awesome 🙏 |
Beta Was this translation helpful? Give feedback.
-
What:
This discussion proposes adding several host functions for working with
String
andBytes
.I'll start by aggregating existing requests from stellar/rs-soroban-sdk#1280, stellar/rs-soroban-env#1187, stellar/rs-soroban-env#1337, stellar/rs-soroban-env#1101.
These are to be added under module "buf" (export = "b").
Why:
These make working with
String
more convenient and efficient, without having to load bytes into the guest side.Beta Was this translation helpful? Give feedback.
All reactions