Stream: contributing

Topic: Fuzzing/Quickcheck for the type checker


view this post on Zulip Ayaz Hafiz (Aug 23 2022 at 15:22):

Similar to #contributing > generating a big Roc program for benchmarking, it would be helpful to have some mechanism for generating Roc programs with certain semantic properties, to check that the compiler is correctly validating or invalidating those properties. Here are a few examples of properties that would be useful for us to check:

All of these are things I'm very interested in exploring more, so if anyone would be interested in helping explore them, I'd be more than happy to assist.

view this post on Zulip Brendan Hansknecht (Aug 23 2022 at 15:54):

Just a note, we have some parser fuzzing setup, but I don't think it works anymore. I think it is easy to fix, but then you just hit panics in parsing super quick, so it isn't very useful.

view this post on Zulip Brendan Hansknecht (Aug 23 2022 at 15:55):

So would have to be a lot smarter than fuzzing currently. Otherwise it will just find our current todos and other panics.

view this post on Zulip Ayaz Hafiz (Aug 23 2022 at 15:55):

Yeah, ideally we would generate ASTs with certain properties

view this post on Zulip Brendan Hansknecht (Aug 23 2022 at 15:56):

I remember looking at trying to generate an AST for fuzzing, but didn't want to deal with all of the bumpalo and references. Makes things a lot lot more annoying to generate.

view this post on Zulip Brendan Hansknecht (Aug 23 2022 at 15:57):

Was looking at setting up random AST to formatter to parser and finally back to AST.

view this post on Zulip Ayaz Hafiz (Aug 23 2022 at 15:57):

yes very true. It may be easier to generate the canonical AST, since that is a much smaller AST surface

view this post on Zulip Ayaz Hafiz (Aug 23 2022 at 15:57):

though that doesn't really cover cases needed for the formatter


Last updated: Jul 06 2025 at 12:14 UTC