Stream: contributing

Topic: Cleaning up panics


view this post on Zulip Tanner Nielsen (Nov 14 2024 at 06:34):

I am interested in helping out with a compiler bug preventing custom abilities from being imported. Would this be feasible for someone new to the roc codebase? For background, I've been using Rust daily at work and personal projects for over a year, but I have no experience with compiler development. I've gotten my fork of the Roc compiler building locally and am able to reproduce the bug. I've poked around the code for awhile but I don't think I'll make much headway without some context. Any guidance is appreciated!

view this post on Zulip Sam Mohr (Nov 14 2024 at 09:12):

From my personal experience getting into the compiler, I think it would be pretty overwhelming to start with what is probably a pretty involved issue. You could do it, but you'd need to touch a lot of different domains. I've found it much easier to start with a smaller domain and touch more and more over time

view this post on Zulip Sam Mohr (Nov 14 2024 at 09:13):

Also, in light of recent static dispatch discussions, I don't know if abilities will exist in Roc long-term. So you'd definitely help people now with current Roc, but you may find yourself working on something that goes away eventually if you pick up this issue

view this post on Zulip Sam Mohr (Nov 14 2024 at 09:15):

However, don't let me stop you from contributing. If you aren't put off by a complex task being your first, I or someone else would be happy to talk through the general process of solving this kind of bug

view this post on Zulip Tanner Nielsen (Nov 14 2024 at 14:20):

Oh shoot, I wasn't aware that abilities might not be here to stay. I'll have to catch up on the static dispatch discussion after work today

view this post on Zulip Tanner Nielsen (Nov 14 2024 at 14:24):

I'm happy to contribute to anything that improves the stability of the compiler, doesn't have to be abilities. I was just irritated by this particular bug because it's blocking me from trying out an idea for my platform. I figured it was more useful to jump in and help than complain about it :smile:

view this post on Zulip Sam Mohr (Nov 14 2024 at 15:19):

That's a good attitude!

view this post on Zulip Brendan Hansknecht (Nov 14 2024 at 16:52):

Static dispatch probably is still far enough out that if this bug annoys you it may be worth fixing. But yeah, I wouldn't be surprised if we have static dispatch by mid January assuming it's all agreed upon shortly. At the same time, it could easily be a year out if no one pushes on it cause abilities work and it has a lot of discussion.

view this post on Zulip Richard Feldman (Nov 14 2024 at 17:41):

yeah I think static dispatch is lower priority than fixing canonicalization and lambda sets, so mid January sounds optimistic to me :big_smile:

view this post on Zulip Luke Boswell (Nov 14 2024 at 19:46):

This is one of the three pinned issues that would help with stability and if you have rust experience could tackle piecemeal while exploring the compiler.

https://github.com/roc-lang/roc/issues/2046

view this post on Zulip Tanner Nielsen (Nov 14 2024 at 22:55):

Thanks @Luke Boswell, that sounds like a great way to get my feet wet with the compiler code while also delivering some incremental value!

view this post on Zulip Tanner Nielsen (Nov 15 2024 at 07:07):

Before chipping away at the panics/expects/etc., I took a stab at enforcing through CI that the total number doesn't increase: https://github.com/roc-lang/roc/pull/7221

view this post on Zulip Tanner Nielsen (Nov 15 2024 at 07:14):

Ah crap, I'll troubleshoot the failing job in the morning. But I'd say the high-level approach is still ready for review.

view this post on Zulip Tanner Nielsen (Nov 15 2024 at 07:16):

I'm also totally cool if we think this is too heavy-handed and we don't want to add it. It just seemed like there was interest for something like this in the issue thread, so I ran with it.

view this post on Zulip Sam Mohr (Nov 15 2024 at 07:18):

This would definitely be a good add! We've definitely seen a user experience gap because of panics in the compiler, and this would help us move towards zero panics (and stay there)

view this post on Zulip Tanner Nielsen (Nov 15 2024 at 16:34):

Any tips for iterating on a pipeline job so you guys don't have to manually approve the workflows on each commit? :sweat_smile:

view this post on Zulip Anton (Nov 15 2024 at 16:36):

I think if you make a PR on your own fork you should be able to run your workflow without needing approval

view this post on Zulip Tanner Nielsen (Nov 15 2024 at 18:15):

Thanks @Anton! I believe got all the issues sorted out through trial and error on my fork. Gotta love troubleshooting in CI :melt:

view this post on Zulip Tanner Nielsen (Nov 15 2024 at 18:16):

The PR linked above should be officially ready to review!


Last updated: Jul 06 2025 at 12:14 UTC