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
I need to thing more about how the whole communication and dependency tracking/resolution would work. Ideas welcome of course
Does it make sense to leave the inter-file dependencies alone, and only use the new parallelism within each file?
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.
I forgot to mention earlier, but I don't think we should take it as a given that a query-based model is ideal!
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
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
hence my idea of picking topological groups
yeah, although even doing that, we can end up with a bunch of decoupled functions that are each in their own groups :big_smile:
hmm we could make a pool of subs that we reset when done
oh yeah that's true
kinda depending on whether we need them later of course, currently we do for monomorphization
This definitely sounds like a good idea assuming it has low enough overhead. I bet it would greatly improve parallelism.
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