leanprover / leanprover/lean4

Missing headers in leanc makes compiling certain FFI libraries painful

Open
#10,831 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P-low
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

Lean comes with a C compiler called leanc, since Lean itself compiles down to C itself.
This is really useful!
However, leanc is missing a bunch of important C headers like stdio.h, which makes compiling certain very important C libraries like SQLite or SDL impossible without gcc or clang.
It would be nice to be able to add the full C standard library to be able to compile more stuff.

Context

#general > SQLite bindings for Lean @ 💬

Steps to Reproduce

N/A

Versions

Lean 4.24, Windows 11

Additional Information

I'm currently working on SQLite bindings for Lean, and I worked on SDL bindings for lean, so in the past, I've had to rely on solutions like using MSYS2 or WSL to compile such bindings on Windows, which is very inconvenient. It would be nice not to have to worry about such things and use Lean's built in C compiler.

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, 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

Start with the leanc entry point and reproduce the missing stdio.h case on Windows 11; the issue names no source file or test. Completion means the needed C standard headers are available for the SQLite or SDL FFI use case without relying on MSYS2 or WSL, with a regression test covering the reported case.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.