Skip to content

Remove Type-in-Type #316

@brendanzab

Description

@brendanzab

Currently Fathom implements Type : Type. This is a common approach for making prototype implementations of dependently typed languages, but it's far too expressive for a binary data description language. It also introduces well-known paradoxes that can lead to non-termination. Instead we should only ever allow Type to appear on the right-hand side of the colon. This could involve adding a check_type function to the elaborator:

pub fn check_type(&mut self, surface_term: &Term<'_, ByteRange>) -> core::Term<'arena> {
    ...
}

Similarly it might also make sense to remove the Format : Type rule, instead checking that Format is a type in the check_type function. This prevent us from defining binary formats that describe other binary formats, but these are probably exceedingly rare, and it's probably good to be more conservative at this point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions