Utility of Helper functions for String <==> Number conversions in the SDK? #1832
wyhaines
started this conversation in
General Discussion
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This question came up in the
developer-chatchannel on the discord last week:I had built a small, specific set of conversion utilities that I needed for a soroban project/experiment that I've been working on for a couple of weeks, and so I fleshed out the pattern to cover the range of conversions, so you can write code like this:
I have these functions in a crate that I've written, and they can be used via this crate (https://crates.io/crates/soroban-render-sdk) now, although they are definitely under-tested and I make no strong claims about the quality of the current implementation.
This brought up some short conversation about whether it would be useful to have functions like these directly in the rust version of the soroban-sdk, and @tupui as well as @leighmcculloch suggested that I open a discussion here to talk about it.
I am weakly opinionated about this. I think that when building applications that interact with contracts, conversions can be frequent, and so there should be some easily found set of well vetted conversion functions available for the developer to use. Having this directly in the SDK seems like the simplest thing, but I feel like they could be in a separate crate, whether that's like where my versions of these are now, in a crate with additional purposes, or it is a narrowly scoped, purpose built crate, though, I don't have any strong opinion about currently. I can see a push and a pull in both directions.
Beta Was this translation helpful? Give feedback.
All reactions