leanprover / leanprover/lean4

RFC: built in option to suppress compilation of defs

Open
#2,619 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Mathlib4 high prio P-high RFC
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Proposal

Add a built in option to disable compilation. Here is one possibility. (Edit: this is too naive.)

  • User Experience: Currently, Lean attempts to compile declarations in noncomputable section's by default. If an error is thrown, then compilation is not required and Lean proceeds. There are large unexpected spikes in compilation leanprover-community/mathlib4#7103 that can occur, especially when the underlying code becomes more efficient to build. Additionally, some modules are not meant for compilation. With the current design, those modules have to mark each declaration noncomputable to avoid the time spent on compilation. This is tedious.

  • Beneficiaries: Until the costs, in terms of compilation, of the current design are more predictable, every user benefits. Users interested in purely mathematical constructions will be able to significantly speed up their workflow.

  • Maintainability: Option bloat is bad. But I think the benefits to users outweighs the cost here.

Community Feedback

Ideas should be discussed on the Lean Zulip prior to submitting a proposal. Summarize all prior discussions and link them here.

We have had multiple discussions about the spikes in the compilation. One of the most recent is here. The main focus there is parsing declarations to attach the noncomputable one by one via automation. However, syntax is very diverse so a broad solution is tricky to implement.

Impact

Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.

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

No implementation files or tests are named. Start by reading the proposal, linked commit, and referenced Zulip discussion; done means agreeing on and implementing a built-in option that suppresses unnecessary compilation without relying on the rejected naive approach.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
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.