Is there a list of planned language features anywhere? I found the list of planned builtins, but I couldn't find a general list of language features. Are they just tracked through GitHub issues, or is there a place for them?
I don't think there is a specific list, but most of the core already exists. I think the biggest known future change is abilities. They were discussed quite a bit in #ideas > Abilities
alright, thank you!
im not sure if this warrants making a new topic, but the reason i asked was because i was wondering if any kind of list destructuring is planned for the future?
Our lists aren't traditional union based linked list, so it may be more complicated to do something to that nature without faking it due to having a traditional vector style representation. If you have specific thought or ideas, discussion in the #ideas stream would be warranted. Otherwise, if anyone knows specific plans past the builtins currently listed, they will probably pitch in when they read this, but I am pretty sure their are no current plans around list destructuring.
okay, thank you!
yeah I explicitly wanted not to have list destructuring because the x :: xs ->
(or first :: rest ->
) style would by default have really bad performance (for the reason Brendan mentioned)
so I didn't want to encourage a footgun with special syntax! :sweat_smile:
makes sense!
thanks!
I guess we could technically have this with good performance, but it would require a slice type that was able to reference a list with a offset. So (pointer to base list, offset, size). It would need to know about the base list for reference counting reasons.
we haven't talked about syntax like [ a, b ] ->
though - I could see that being useful, and actually good for performance!
like it only matches on that if there are exactly two elements in the list, and names them both
that would save a bounds check
Makes me think about how in c++ sometimes adding a statement like assert(x.size() >= 5)
before using the first 5 elements of a list will make the code faster because it helps the compiler realize it doesn't need to do 5 separate bounds checks.
is that all LLVM?
like if I did if List.len list > 5 then
and then put several List.get
and/or List.set
calls after the then
which all accessed indices between 0 and 4, would LLVM optimize away the bounds checks for me?
To my understanding, yes. Of course some of the time it is smart enough to figure it out by itself, but not always.
super awesome
I just tested this. It 100% works. Adding the if beforehand causes llvm to remove all of the checks and just directly modify the array.
niiiice
in Roc?
Yeah
Though not sure what to do in the else branch.
In my test just had it return the original list if it was too small
the else
branch would presumably do whatever any of the failed Result
s would do
With List.set
, that would be panic. Which isn't exposed
oh List.set
doesn't panic on out of bounds, - it returns the same list it was given...so I guess returning the original list in the else
branch makes sense in that case! :big_smile:
Haha....forgot.
Last updated: Jul 06 2025 at 12:14 UTC