Stream: ideas

Topic: Granular Type Checking and Specialization


view this post on Zulip Folkert de Vries (Mar 06 2022 at 21:35):

Wrote up a bit of what we discussed earlier https://github.com/rtfeldman/roc/issues/2665

tldr: what if we split up your modules into many smaller modules, so we could do more things in parallel

view this post on Zulip Folkert de Vries (Mar 06 2022 at 21:36):

I need to thing more about how the whole communication and dependency tracking/resolution would work. Ideas welcome of course

view this post on Zulip Derek Gustafson (Mar 06 2022 at 21:41):

Does it make sense to leave the inter-file dependencies alone, and only use the new parallelism within each file?

view this post on Zulip Ayaz Hafiz (Mar 06 2022 at 21:43):

I like this a lot, this gets us closer a query-based model too.

I think we can just ask the question “what does this function depend on” and sort things that way. we need to be careful around module boundaries as you mention but then the module matters only for “forcing” the resolution of one dependency before another.

view this post on Zulip Richard Feldman (Mar 06 2022 at 21:43):

I forgot to mention earlier, but I don't think we should take it as a given that a query-based model is ideal!

view this post on Zulip Ayaz Hafiz (Mar 06 2022 at 21:43):

I think the new parallelism is the most powerful when it’s cross-file, the insight was that the per-file parallelism we have today winds up being almost sequential because of file dependencies

view this post on Zulip Folkert de Vries (Mar 06 2022 at 21:45):

one worry is: how fine-grained do we want to really be? making a Subs is like 8 Vecs that we're making and doing things per-function means a lot of bookkeeping

view this post on Zulip Folkert de Vries (Mar 06 2022 at 21:45):

hence my idea of picking topological groups

view this post on Zulip Richard Feldman (Mar 06 2022 at 21:46):

yeah, although even doing that, we can end up with a bunch of decoupled functions that are each in their own groups :big_smile:

view this post on Zulip Folkert de Vries (Mar 06 2022 at 21:46):

hmm we could make a pool of subs that we reset when done

view this post on Zulip Richard Feldman (Mar 06 2022 at 21:47):

oh yeah that's true

view this post on Zulip Folkert de Vries (Mar 06 2022 at 21:47):

kinda depending on whether we need them later of course, currently we do for monomorphization

view this post on Zulip Brendan Hansknecht (Mar 07 2022 at 05:53):

This definitely sounds like a good idea assuming it has low enough overhead. I bet it would greatly improve parallelism.

view this post on Zulip Brendan Hansknecht (Mar 07 2022 at 05:54):

Also, if types are explicitly specified, it would be great if we could decouple thing even more. Since that theoretically is the contract and the dependency on the other function isn't really needed anymore.


Last updated: Jun 16 2026 at 16:19 UTC