Stream: contributing

Topic: Update the builtins to `snake_case`??


view this post on Zulip Luke Boswell (Dec 16 2024 at 21:28):

I can't believe I'm suggesting this... I guess I love big PR's... anyway.

@Sam Mohr pointed out that we are effectively making a breaking change with the basic-cli PI changes. Also we have Str.fromUtf8 staged ready to go.

Maybe we should just double down and make all the builtins snake_case too, and do another big-bang release all the new things together when we've had time to polish them and test everything?

This would delay basic-cli and webserver PI landing until probably mid-late Jan though.

If we keep it as is, there's a chance we land those upgrades (in pre-release form) later this week in time for Christmas and the holiday season (I assume everyone else get's holidays around this time of year :holiday_tree: )

It is a little strange seeing the occasional Str.camelCase for builtins, but I'd say it's pretty minor impact.

view this post on Zulip Brendan Hansknecht (Dec 16 2024 at 21:32):

I would push to release it sooner rather than later

view this post on Zulip Brendan Hansknecht (Dec 16 2024 at 21:32):

Many breaking changes are in the pipeline. As they arrive we can keep cutting new releases.

view this post on Zulip Brendan Hansknecht (Dec 16 2024 at 21:33):

That gets it tested and gets people to avoid Task, which is really nice

view this post on Zulip Brendan Hansknecht (Dec 16 2024 at 21:34):

Hopefully not too long from now, I'll be fixing abi stuff (which also will probably be a breaking change for all platforms).

view this post on Zulip jan kili (Dec 16 2024 at 21:35):

For AoC folks, would this look like "hey while you're here, here's an optional upgrade to try some 2025 Roc syntax"?

view this post on Zulip Brendan Hansknecht (Dec 16 2024 at 21:36):

Even if it releases before Christmas, I don't think we really need to push this year aoc over to it

view this post on Zulip Brendan Hansknecht (Dec 16 2024 at 21:37):

Just note that people can try it and we would love bug reports

view this post on Zulip Richard Feldman (Dec 16 2024 at 21:41):

yeah also keep in mind that at this point pretty much everyone is either done with AoC or already has a working setup and doesn't need to change anything :big_smile:

view this post on Zulip Richard Feldman (Dec 16 2024 at 21:42):

also we can release a new basic-cli without updating the tutorial to reference it

view this post on Zulip Sam Mohr (Dec 16 2024 at 21:43):

I think PI is so good that making people wait until January isn't worth it. I presume a casual Roc user would prefer having two breaking updates released as they are ready rather than having to wait a month and a half for a polished single break

view this post on Zulip Richard Feldman (Dec 16 2024 at 21:47):

also I think landing it with a note in the readme like "hey fyi we're in the middle of a snake_case transition in case you're wondering why this is snake_case and builtins aren't!"

view this post on Zulip Richard Feldman (Dec 16 2024 at 21:47):

would be helpful

view this post on Zulip jan kili (Dec 16 2024 at 21:52):

Richard Feldman said:

yeah also keep in mind that at this point pretty much everyone is either done with AoC or already has a working setup and doesn't need to change anything :big_smile:

True, there's a low chance of someone needing a bugfix in the next few weeks.

view this post on Zulip Anthony Bullard (Dec 16 2024 at 22:08):

I’ll get the formatter fixed right now to make the builtins transition a little faster

view this post on Zulip Anthony Bullard (Dec 16 2024 at 22:09):

Get ready to List.walk_with_index_until

view this post on Zulip Anthony Bullard (Dec 16 2024 at 22:10):

Luckily I think walking generally will go the way of the buffalo with for

view this post on Zulip jan kili (Dec 16 2024 at 22:25):

If I wasn't logging off for the day I'd write a working Roc app version of the "buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo buffalo" sentence.

view this post on Zulip Anthony Bullard (Dec 16 2024 at 22:55):

Damn, forgot I needed to update to LLVM18 and Zig 13

view this post on Zulip Anton (Dec 17 2024 at 10:55):

Should be pretty easy to upgrade

view this post on Zulip Anthony Bullard (Dec 17 2024 at 11:25):

Yeah, it wasn't bad at all

view this post on Zulip Anthony Bullard (Dec 17 2024 at 11:25):

Just brew takes a while sometimes, and I only had 20 minutes :-)

view this post on Zulip Brendan Hansknecht (Dec 17 2024 at 15:55):

This is where nix is super amazing

view this post on Zulip Anthony Bullard (Dec 17 2024 at 17:52):

Yeah just having a program make such major changes to my file system is just not something I feel comfortable with until I have time to understand it deeply - which isn’t right now :grinning_face_with_smiling_eyes:

view this post on Zulip Anton (Dec 17 2024 at 18:07):

What's the origin of your trauma? :p

view this post on Zulip Brendan Hansknecht (Dec 17 2024 at 18:21):

To be fair, nix has its own folder and is pretty contained

view this post on Zulip Brendan Hansknecht (Dec 17 2024 at 18:21):

Just downloads a lot of crap and makes them priority in path

view this post on Zulip Anthony Bullard (Dec 17 2024 at 18:55):

For me I’m sure nix is great. Lots of people love it. I just want to actually understand all the pieces before I go in

view this post on Zulip Luke Boswell (Dec 17 2024 at 18:55):

Nix is a very deep rabbit hole

view this post on Zulip Anthony Bullard (Dec 17 2024 at 18:57):

I know and I don’t have enough time to visit

view this post on Zulip Anthony Bullard (Dec 17 2024 at 18:58):

Maybe 30 mins in the morning and sometimes 30 at night

view this post on Zulip Anthony Bullard (Dec 17 2024 at 18:58):

The rest of my time is looking at Zulip while waiting for something to load or compile at work

view this post on Zulip Brendan Hansknecht (Dec 17 2024 at 19:01):

Anthony Bullard said:

I just want to actually understand all the pieces before I go in

Depending on your definition of understand that may be impossible at this point

view this post on Zulip Anthony Bullard (Dec 17 2024 at 19:07):

Brendan Hansknecht said:

Anthony Bullard said:

I just want to actually understand all the pieces before I go in

Depending on your definition of understand that may be impossible at this point

You aren’t selling it :joy:

view this post on Zulip Luke Boswell (Dec 17 2024 at 19:12):

Reminds me of this

https://roc.zulipchat.com/#narrow/channel/306878-off-topic/topic/.F0.9F.A6.86.20typing/near/476221984

If only I knew how to drive a meme generator, there's an opportunity here somewhere @Anthony Bullard

view this post on Zulip Brendan Hansknecht (Dec 17 2024 at 19:21):

You aren’t selling it :joy:

Just being honest. It is one of those super complex systems that getting a rough picture of isn't too hard, but truly understanding +especially the full thing) is exceptionally difficult. Just like Linux or many other large pieces of software. Made worse by the fact it is trying to deterministically and idempotently manage essentially all software in existence.

view this post on Zulip Brendan Hansknecht (Dec 17 2024 at 19:22):

At the same time, it is simply awesome. I CD into my roc dir. It automatically loads up every dependency and everything just works.

view this post on Zulip Anton (Dec 18 2024 at 11:38):

Being able to go back to old commits and being 100% sure all the dependencies are correct is a life-saver too. An order of magnitude more convenient compared to manually uninstalling and installing things.

view this post on Zulip Brendan Hansknecht (Dec 18 2024 at 17:30):

Yeah, makes bisecting bugs and measuring perf changes way easier.

view this post on Zulip Luke Boswell (Dec 28 2024 at 22:46):

I've been thinking about this a bit more...

Can we duplicate the builtins, and expose both a snake_case and the current version to assist with a transition.

This wouldn't be a breaking change I think.

We have doubled the number of functions in the builtins, though we could mitigate this by keeping all the new/old functions together and not mixing them so they aren't displayed together in the docs.

view this post on Zulip Sam Mohr (Dec 28 2024 at 22:52):

This wouldn't be breaking. If you think it'd be less effort than just making the change (which I expect would be the case), then this is a good idea.

view this post on Zulip Sam Mohr (Dec 28 2024 at 22:53):

There is probably a way to automatically do this. Any function call to a builtin gets translated from camelCase to snake_case

view this post on Zulip Anthony Bullard (Dec 28 2024 at 22:53):

So you would see all the camelCase and then all the snake_case ones?

view this post on Zulip Sam Mohr (Dec 28 2024 at 22:53):

And that gets paired with a change of the builtins to be snake_case

view this post on Zulip Anthony Bullard (Dec 28 2024 at 22:53):

You could migrate it, copy, undo the changes, and then paste :-)

view this post on Zulip Luke Boswell (Dec 28 2024 at 22:57):

I was thinking... of duplicating, and replacing the implementation with an alias

view this post on Zulip Richard Feldman (Dec 28 2024 at 22:58):

I think this would be really confusing to anyone who visits the builtin docs during the transition :sweat_smile:

view this post on Zulip Sam Mohr (Dec 28 2024 at 22:59):

That seems like more effort than having canonicalization-level translation

view this post on Zulip Luke Boswell (Dec 28 2024 at 22:59):

Richard Feldman said:

I think this would be really confusing to anyone who visits the builtin docs during the transition :sweat_smile:

Yes, I agree... this is my main concern

view this post on Zulip Richard Feldman (Dec 28 2024 at 22:59):

I think it's probably less disruptive to just make the breaking change

view this post on Zulip Luke Boswell (Dec 28 2024 at 23:00):

Richard Feldman said:

I think it's probably less disruptive to just make the breaking change

It's pretty painful getting fresh releases of all the platforms coordinated

view this post on Zulip Sam Mohr (Dec 28 2024 at 23:01):

Actually, roc migrate should just make this pretty simple

view this post on Zulip Anthony Bullard (Dec 28 2024 at 23:01):

If we get my PR in, migrate should work flawlessly: https://github.com/roc-lang/roc/pull/7402

view this post on Zulip Anthony Bullard (Dec 28 2024 at 23:01):

I just need to back out the snapshot stuff

view this post on Zulip Anthony Bullard (Dec 28 2024 at 23:02):

Anyone else that has time can feel free to do that as well. It's dinner time in the Bullard Household :pizza:

view this post on Zulip Luke Boswell (Dec 28 2024 at 23:02):

I'm not worried about actually implementing the change to snake case in the builtins .roc files... it's the impact on the platforms and ecosystem from a breaking change that makes it difficult to land.

view this post on Zulip Luke Boswell (Dec 28 2024 at 23:03):

I'm hoping we might be able to find another solution

view this post on Zulip Luke Boswell (Dec 28 2024 at 23:04):

If the duplicate (the current camelCase version) doesn't have any doc comments, it's not going to show in the docs right?

view this post on Zulip Luke Boswell (Dec 28 2024 at 23:05):

So to clarify @Richard Feldman, it's only confusing in the sense that you see current code that works, but can't see the camelCase version in the builtin docs... but it is there in snake_case form

view this post on Zulip Richard Feldman (Dec 28 2024 at 23:06):

I think the duplicate version will prob still show up even without doc comments

view this post on Zulip Richard Feldman (Dec 28 2024 at 23:06):

but we could manually filter those out

view this post on Zulip Richard Feldman (Dec 28 2024 at 23:06):

for builtins

view this post on Zulip Richard Feldman (Dec 28 2024 at 23:06):

or just temporarily change how that works in roc docs - I don't think anyone is relying on it for things that don't have doc comments at the moment :big_smile:

view this post on Zulip Luke Boswell (Dec 28 2024 at 23:07):

Would it be a feature that is needed in future, like a doc comment that says "dont include in the docs"?

view this post on Zulip Richard Feldman (Dec 28 2024 at 23:07):

nah

view this post on Zulip Richard Feldman (Dec 28 2024 at 23:07):

we can just temporarily do without

view this post on Zulip Anthony Bullard (Jan 01 2025 at 04:17):

Related topic, and feel free to move this out if it feels right, but with PNC about to land should we make sure to include that. And @Luke Boswell if this is going to be a while, should I make the migration flag parameterizable so that we could just migrate one of (snake_case and PNC)?

view this post on Zulip Luke Boswell (Jan 01 2025 at 04:25):

I'm not quite following your question... what should we include?

view this post on Zulip Luke Boswell (Jan 01 2025 at 04:25):

Do you feel we should get the snake_case builtins in before PNC?

view this post on Zulip Anthony Bullard (Jan 01 2025 at 04:26):

I mean when you do the migration - should we make sure to wait for PNC to land and just do it at once. It has no actual impact on user code at all

view this post on Zulip Anthony Bullard (Jan 01 2025 at 04:26):

And the second part - pointed at you - is do you think the snake_case migration will take long enough that we'll want to do the PNC migration separate?

view this post on Zulip Luke Boswell (Jan 01 2025 at 04:27):

Ah, yeah that could be good. I was only thinking of changing the function definitions and not all of the code/impl.

view this post on Zulip Anthony Bullard (Jan 01 2025 at 04:27):

Oh right, you are just going to kind of proxy it in can or something?

view this post on Zulip Luke Boswell (Jan 01 2025 at 04:27):

As in I was thinking of just doing the user facing/affecting stuff, and looking for a way to mitigate the impact

view this post on Zulip Anthony Bullard (Jan 01 2025 at 04:28):

Ok, well maybe we can do it as a separate piece of work

view this post on Zulip Anthony Bullard (Jan 01 2025 at 04:28):

As soon as we have your change in, I want to migrate the examples full bore

view this post on Zulip Luke Boswell (Jan 01 2025 at 04:29):

No, we discussed duplicating the exposed definitions with both the current and a snake_case version. Like having both Result.mapErr and Result.map_err and then just filtering out the non snake case version manually so it doesnt show in the docs website

view this post on Zulip Luke Boswell (Jan 01 2025 at 04:30):

I haven't started on this yet... I've been taking a little break doing other side projects around the house

view this post on Zulip Anthony Bullard (Jan 01 2025 at 04:30):

No worries and no rush at all!

view this post on Zulip Luke Boswell (Jan 01 2025 at 04:30):

I'm not stressed when we do it, I just was wanting a way to migrate incrementally.


Last updated: Jul 06 2025 at 12:14 UTC