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

Package manager that works smoothly on Linux/OSX/Windows #397

Closed
leodemoura opened this issue Apr 13, 2021 · 6 comments
Closed

Package manager that works smoothly on Linux/OSX/Windows #397

leodemoura opened this issue Apr 13, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@leodemoura
Copy link
Member

The goal is to have something like Rust Cargo.
https://github.com/rust-lang/cargo
It should be implemented in Lean.
Core developers will help with missing APIs.

@leodemoura leodemoura added the help wanted Extra attention is needed label Apr 13, 2021
@tydeu
Copy link
Member

tydeu commented May 19, 2021

Fyi, I posted a thread on Zulip (leanpkg++ idea) related to a design idea for the new leanpkg. The basic idea is for developers to write package configuration in Lean itself rather than through something like leanpkg.toml. This would make builds in Lean much more flexible and allow for leveraging Lean's extensive metaprogramming capabilities in package managment. The idea seems to have some support, so it might be worth looking into.

@DanielFabian
Copy link
Contributor

The idea seems to be related to FAKE from F# or the Zig language as per the mentioned thread.

@saulshanabrook
Copy link

Hey all, I am just starting to learn Lean and wanted to give my perspective coming from the Python community, that sticking with a declarative package instead of using Lean to specify dependencies might have advantages.

The Python folks have spent a long time moving away from package information as code (setup.py) to declarative files (pyproject.toml) (emphasis mine):

The traditional setuptools way of packaging Python modules uses a setup() function within the setup.py script. Commands such as python setup.py bdist or python setup.py bdist_wheel generate a distribution bundle and python setup.py install installs the distribution. This interface makes it difficult to choose other packaging tools without an overhaul. Because setup.py scripts allowed for arbitrary execution, it proved difficult to provide a reliable user experience across environments and history.

PEP 517 therefore came to rescue and specified a new standard to package and distribute Python modules. Under PEP 517:

a pyproject.toml file is used to specify what program to use for generating distribution.
[...]

With this standard, switching between packaging tools becomes a lot easier. build_meta implements setuptools’ build system support.

@tydeu
Copy link
Member

tydeu commented Sep 3, 2021

@saulshanabrook I agree that declarative specification of dependencies is useful. However, I think that can be accomplished even with an interpreted configuration through the use of a lock file. Also, it should be noted that even in the case you described, the build system is still written in Python -- it is only dependency listing itself that is declarative (making it much the same as a lock file).

One other thing to note is that unlike python, where there is a pretty straightforward mapping between a package and an import, a package in Lean may end up containing many other things besides the module itself, and those things may wish to be configurable via scripting. For example, Lean package may even end up containing scriptable, custom UI widgets that may also wish to be configurable via the package script.

TL;DR Dependencies should ideally have a declarative listing. Other package management tasks (i.e., builds and complex configurations) need interpreted scripting.

@leodemoura leodemoura added enhancement New feature or request and removed help wanted Extra attention is needed labels Jul 28, 2022
ChrisHughes24 pushed a commit to ChrisHughes24/lean4 that referenced this issue Dec 2, 2022
@kassane
Copy link

kassane commented Aug 31, 2023

The idea seems to be related to FAKE from F# or the Zig language as per the mentioned thread.

zig v0.11.0 releases zig-pkg initial support [WiP].

@digama0
Copy link
Collaborator

digama0 commented Aug 31, 2023

I think this issue is closed now that we have lake?

@tydeu tydeu closed this as completed Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants