FStarLang / FStarLang/karamel

Specify functions that must extract?

Open
#482 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
OCaml
Stars
519
Forks
73
Avg merge
2h 58m
Merged PRs (30d)
1

Description

This is more of a question really. A snippet like
```fstar
open FStar.Seq

module U32 = FStar.UInt32

[@@Comment "test"]
let f (x:U32.t) (s : seq int) : U32.t = x
```
will be dropped (albeit raising a warning) since `seq` does not have a definition (it should probably erasable.. but that's a whole thing F* responsibility). I was wondering if we could

- Support a keywork/attribute to specify that something *must* extract, and failhard if it doesn't. I see a note in
F*'s examples/kv_parsing/README.md that this could be useful, wondering if you see any gotchas with adding this logic to F*/krml.
- If the function has a "C" attribute, like above, I think it's a reasonable assumption that this was meant to actually extract, and hence trigger the logic above. I'm not convinced it's a good idea, just putting it out there (it can be an F*-only patch, and we could set it with an extension, so it's not a big deal either).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading examples/kv_parsing/README.md, then inspect how F*/KaRaMeL currently handles extraction and C attributes. Clarify whether a must-extract attribute or C annotation belongs in F* or KaRaMeL, including failure behavior and any gotchas; done means an agreed design and defined scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ocaml
Domain
compilers, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.