FStarLang / FStarLang/FStar

assert are never extracted even with `--mlish`

Open
#984 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/error-messages component/extraction good first issue
Dominant language
F*
Stars
3.1k
Forks
267
Avg merge
10h 45m
Merged PRs (30d)
54

Description

The function assert is never extracted to OCaml. This is not very nice when using the ocaml-based F* compiler and getting a Failure("Impossible") because an invariant was broken.

It would be nice to extract the assertions when they do correspond to runtime checks as they are in the compiler.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the assert function is handled during --mlish extraction to OCaml, comparing it with assertions that become runtime checks in the compiler. Identify the extraction entry point and existing tests covering assertions. Done means assertions that correspond to runtime checks are preserved in the generated OCaml instead of causing Failure("Impossible").

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.