Are the Roc compiler's intermediate representations documented somewhere? I've been digging in the "mono" crate. Any other parts of the source repo I should be looking at?
Not a direct answer, but I generally explore them by using the goto definition feature of my editor
For Mono, the type definition of Stmt
and Expr
are the most important
What in general are you trying to figure out?
Just generally interested in seeing how the source is transformed, and also curious about how effects are represented internally.
Currently, they really are just cffi with extra rules. Once effect interpreters are standard, it will essentially be the same as an async task in a language like rust.
Oh, I see. I assumed that some sort of continuation would need to be captured in the IR. Is that not the case?
There is a continuation, but it really is just. Make continuation, call function with cffi, run continuation with result.
Got it. Thanks for the info!
Last updated: Jul 05 2025 at 12:14 UTC