Zulip Chat Archive
Stream: general
Topic: remove unused library in compiled file
Locria Cyber (Nov 15 2025 at 05:30):
Someone mentioned that
import Lean.Data.Json.Parser
def main := IO.println "Hello, world!"
This code compiles to 135M.
Compiled with lake build.
Is there anything i can do to make the executable file size smaller? This should be a task done by the compiler, I think.
Henrik Böving (Nov 15 2025 at 11:14):
The easiest thing for you would be to call strip on the binary. In general importing anything from Lean calls into action a lot of code that we can't easily get rid of but we could still do a better job yes.
Anthony Wang (Nov 15 2025 at 14:25):
There's an open issue about this bug: https://github.com/leanprover/lean4/issues/5274
Last updated: Dec 20 2025 at 21:32 UTC