Stream: beginners

Topic: list of planned language features?


view this post on Zulip Emi (Feb 22 2022 at 00:24):

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?

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 00:50):

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

view this post on Zulip Emi (Feb 22 2022 at 00:51):

alright, thank you!

view this post on Zulip Emi (Feb 22 2022 at 00:52):

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?

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 00:56):

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.

view this post on Zulip Emi (Feb 22 2022 at 00:59):

okay, thank you!

view this post on Zulip Richard Feldman (Feb 22 2022 at 01:15):

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)

view this post on Zulip Richard Feldman (Feb 22 2022 at 01:16):

so I didn't want to encourage a footgun with special syntax! :sweat_smile:

view this post on Zulip Emi (Feb 22 2022 at 01:21):

makes sense!
thanks!

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 01:34):

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.

view this post on Zulip Richard Feldman (Feb 22 2022 at 01:41):

we haven't talked about syntax like [ a, b ] -> though - I could see that being useful, and actually good for performance!

view this post on Zulip Richard Feldman (Feb 22 2022 at 01:41):

like it only matches on that if there are exactly two elements in the list, and names them both

view this post on Zulip Richard Feldman (Feb 22 2022 at 01:41):

that would save a bounds check

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 01:43):

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.

view this post on Zulip Richard Feldman (Feb 22 2022 at 01:44):

is that all LLVM?

view this post on Zulip Richard Feldman (Feb 22 2022 at 01:45):

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?

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 01:55):

To my understanding, yes. Of course some of the time it is smart enough to figure it out by itself, but not always.

view this post on Zulip Richard Feldman (Feb 22 2022 at 02:05):

super awesome

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 02:11):

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.

view this post on Zulip Richard Feldman (Feb 22 2022 at 02:25):

niiiice

view this post on Zulip Richard Feldman (Feb 22 2022 at 02:25):

in Roc?

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 02:39):

Yeah

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 02:40):

Though not sure what to do in the else branch.

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 02:41):

In my test just had it return the original list if it was too small

view this post on Zulip Richard Feldman (Feb 22 2022 at 02:52):

the else branch would presumably do whatever any of the failed Results would do

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 03:06):

With List.set, that would be panic. Which isn't exposed

view this post on Zulip Richard Feldman (Feb 22 2022 at 03:33):

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:

view this post on Zulip Brendan Hansknecht (Feb 22 2022 at 03:41):

Haha....forgot.


Last updated: Jul 06 2025 at 12:14 UTC