Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing FStar.Prelude, removing special casing for Prims/Pervasives internally #3732

Merged
merged 15 commits into from
Feb 11, 2025

Conversation

mtzguido
Copy link
Member

This PR changes the behavior of F* to automatically open the module FStar.Prelude in every file, instead of Prims and Pervasives. (We also open the FStar namespace, that is retained.)

The main improvement is that there is no special list of core modules that do not incur default dependencies, and instead we can mark a module with the [@@"no_prelude"] attribute to indicate it should not open the prelude. This in turn allows to edit these base modules much more easily. The last two patches here move some of the bulk of Pervasives into separate modules, which makes it easier to read them. These modules are included in the prelude too, so then most users do not "notice".

In particular this allowed me to easily break a dependency problem with the norm_steps in the compiler referring to Pervasives.norm_step (of the parent compiler) which was definitely wrong.

Note this also means there's nothing special about Prims anymore either.

@mtzguido mtzguido force-pushed the prelude branch 2 times, most recently from 2376690 to 2fe9c73 Compare February 10, 2025 17:01
@mtzguido mtzguido force-pushed the prelude branch 2 times, most recently from 7b86ba2 to aba3abb Compare February 11, 2025 01:36
@mtzguido mtzguido enabled auto-merge February 11, 2025 05:58
@mtzguido mtzguido merged commit 37ad4a1 into FStarLang:master Feb 11, 2025
8 of 9 checks passed
@mtzguido mtzguido deleted the prelude branch February 11, 2025 06:32
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