-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Clarity] concat
should allow to concatenate more than 2 sequences at once.
#3056
Comments
Hey @LNow,
What leads you to believe that |
@jcnelson the answer to your question is quite simple. Current execution costs. Using example I posted above. Multiple nested
Fold:
Of course the more elements we have to concat, multiple nested concat's consumes more |
One thing we could do, regardless of how we address this, is make it so the Clarity VM does not re-run the type checks (and associated runtime costs) on each application of the function in |
See also the proposal for variadic concat at clarity-lang/reference#17 |
PR #3294 is still in-flight and will be included in the next VM upgrade |
Temporarily assigning this to @obycode. Please feel free to re-assign. |
Is your feature request related to a problem? Please describe.
I want to concatenate more than 2 sequences at once without using
fold
because it is to expensive (execution costs wise).Describe the solution you'd like
concat
function should take 2 or more sequences of the same type and returns a concatenated sequence of the same type, with the resulting sequence_len = sequence1_len + sequence2_len ...+ ... sequenceN_len.Instead of this:
I'd like to be able to do this:
Describe alternatives you've considered
It is quite easy to concatenate multiple sequences using
fold
, but this approach is quite expensive.The text was updated successfully, but these errors were encountered: