Stream: beginners

Topic: Compiler IR


view this post on Zulip Nicolo Davis (Jan 24 2024 at 05:50):

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?

view this post on Zulip Brendan Hansknecht (Jan 24 2024 at 05:51):

Not a direct answer, but I generally explore them by using the goto definition feature of my editor

view this post on Zulip Brendan Hansknecht (Jan 24 2024 at 05:52):

For Mono, the type definition of Stmt and Expr are the most important

view this post on Zulip Brendan Hansknecht (Jan 24 2024 at 05:53):

What in general are you trying to figure out?

view this post on Zulip Nicolo Davis (Jan 24 2024 at 05:55):

Just generally interested in seeing how the source is transformed, and also curious about how effects are represented internally.

view this post on Zulip Brendan Hansknecht (Jan 24 2024 at 05:56):

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.

view this post on Zulip Nicolo Davis (Jan 24 2024 at 06:01):

Oh, I see. I assumed that some sort of continuation would need to be captured in the IR. Is that not the case?

view this post on Zulip Brendan Hansknecht (Jan 24 2024 at 06:41):

There is a continuation, but it really is just. Make continuation, call function with cffi, run continuation with result.

view this post on Zulip Nicolo Davis (Jan 24 2024 at 07:10):

Got it. Thanks for the info!


Last updated: Jul 05 2025 at 12:14 UTC