Skip to content

Introduce ESizeof to InputAST#743

Open
mtzguido wants to merge 1 commit into
FStarLang:masterfrom
mtzguido:sizeof
Open

Introduce ESizeof to InputAST#743
mtzguido wants to merge 1 commit into
FStarLang:masterfrom
mtzguido:sizeof

Conversation

@mtzguido
Copy link
Copy Markdown
Member

This allows F* extraction to generate sizeof expressions instead of having to compute sizes internally (impossible for structs due to padding etc).

I got help from Claude for the translation into CFlat, I think it looks right but worth a look.

This does not add tests, unsure what's a nice way to do that since writing a test in F* implies formalizing sizeof to some extent, which we could do but not sure that's a prerequisite. Kuiper is using this already and working well for the C backend at least.

This allows F* extraction to generate sizeof expressions instead of
having to compute sizes internally (impossible for structs due to
padding etc).

I got help from Claude for the translation into CFlat, I think it looks
right but worth a look.

This does not add tests, unsure what's a nice way to do that since
writing a test in F* implies formalizing sizeof to some extent, which we
could do but not sure that's a prerequisite. Kuiper is using this
already and working well for the C backend at least.
mtzguido added a commit to FStarLang/FStar that referenced this pull request May 16, 2026
mtzguido added a commit to FStarLang/FStar that referenced this pull request May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant