Stream: compiler development

Topic: zig compiler - Types verse Content


view this post on Zulip Luke Boswell (Feb 16 2025 at 05:23):

Does anyone know the difference between Types in crates/compiler/types/src/types.rs and Content in crates/compiler/types/src/subs.rs?

I found this clue... in the docs for Types

/// Memory-dense storage of canonicalized types, sitting between the user-facing type syntax and
/// the [type solving representation][crate::subs::Content] of types.

Can we have a single representation now or do they need to be different for some reason?

view this post on Zulip Luke Boswell (Feb 16 2025 at 05:26):

The only thing I can think of is maybe the Can version needs to keep Region information around for error reporting

view this post on Zulip Luke Boswell (Feb 16 2025 at 22:07):

Note to self -- I'd like to try unifying these and use the single representation. Also SoA using Idx's would be nice.

view this post on Zulip Luke Boswell (Feb 19 2025 at 04:18):

@Sam Mohr -- thinking about the TypeId (from Rust's VarStore) and moved into the SoloEnv. Here's a commit from my WIP type-check PR https://github.com/roc-lang/roc/pull/7608/commits/15df5fa2007c20b0724aae48b0457abd587bd113

We can migrate it into CombinedEnv also to be used in later stages when we want to generate a unique id.

view this post on Zulip Sam Mohr (Feb 19 2025 at 04:21):

Sounds good. We'll want to put that back as just ModuleEnv though since we aren't doing module sets anymore, it'll just be the same env the whole way through

view this post on Zulip Luke Boswell (Feb 19 2025 at 04:21):

Oh nice... no need to change then

view this post on Zulip Luke Boswell (Feb 19 2025 at 04:21):

A single ModuleEnv was much easier to understand


Last updated: Jul 06 2025 at 12:14 UTC