Skip to content
No description, website, or topics provided.
HTML Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
Makefile
README.md
sin.gif
sin.html
sin.md
sin.pdf

README.md

TODO

functional package manager

graph of sin function

Status

Very Early Draft

Abstract

The idea is to make it very easy to build, install and run scheme projects even if they have depedencies, rely on a foreign function interface or some other services not written in Scheme without any superuser rights.

Rationale

Functional package managers are a great idea, we need more of those, especially for Scheme. While there is a couple of existing package manager for Scheme. They are not as elegant as functional package manager. Also they can not install shared libraries. They can not install and run services written in other programming languages. By adopting the functional package manager paradigm, Scheme implementations will be in a unique position compared to other programming language implementations.

Getting together a full environment is difficult task for a new user. By automating and creating a standard way to package, distribute and run Scheme projects, it will help new and experienced user to not only share their creation but also more easily switch between Scheme implementations when that is necessary.

The common command line interface should help further jump between Scheme implementations. The package definition might be useful to create a core seed of bootstrap binaries and definitions for softwares not written in Scheme that will be more widely tested. The freeze file format will allow new and experienced developer to easily reproduce a working environment.

sin try to achieve much less than existing functional package manager that also support relocatable binaries, setting up full operating systems, virtual machines, containers and clusters of machines. Other things that are left out from the specification is full source reproducibility and completly sealed build environments.

Specification

Sin can resolve, build and install dependencies of Scheme programs in user's home directory without interfering with the host system by relying on shell virtual environments. It can manage to run whole projects possibly running multiple processus. Multiple virtual environments can happily live together in parallel. Every environment is identified by a freeze file that will allow to reproduce it. Sin can identify each installed software based on its source and associated configuration in order to de-duplicate work and save disk space.

This document specify the command line tool, the package definition format, the freeze file format and the file store.

Command Line Tool

The command line start with sin and followed by SUBJECT VERB COMPLEMENT ... pattern:

sin pull
sin gc
sin environment init [FILENAME]
sin environment shell [-- COMMAND ...]
sin environment freeze
sin package install PACKAGE-NAME ...
sin package search KEYWORD -MINUS ...
sin package remove PACKAGE-NAME ...

TODO: describe each subcommands

Package Definition

Package definition are association list that define some metadata about the package (title, description, url, version), source information (url, sha256, possibly git-commit) and build process (build dependencies), runtime requirements (runtime dependencies) along possibly propagated dependencies and a build procedure:

Example definition for a package called datae-v2:

(import (sin packages chez-exe))
(import (sin packages arew-scheme))


(define datae-v2 `((title . "datae")
                   (url . "https://github.com/awesome-data-distribution/datae")
                   (version . (2 0))
                   (description . "functional database")
                   (url . "https://git.sr.ht/~amz3/scheme-arew")
                   (git-commit . "v0.1.1")
                   (sha-256 . "0123456789ABCDEF")
                   (dependencies-build . ((arew-scheme . ,arew-scheme)
                                          (chez-exe . ,chez-exe)))
                   (dependencies-run-time . ((wiredtiger . ,wiredtiger)))
                   (dependencies-propagated . ((arew-scheme . ,arew-scheme)))
                   (build . (lambda (store package out) ...))))

TODO: describe build procedure

Freeze

sin environment freeze is a way to freeze an environment with packages and services configuration. It is done in way that allows another user to reproduce a working environment without necessarly having all the package definitions locally in the store. It also allows to configure the services.

One can use sin environment init FILENAME to reproduce the frozen environment.

Files

~/.local/sin/config.scm
~/.local/sin/definitions/datae-v2.scm
~/.local/sin/local/datae-v2-P4X432/
...

Implementation

...

Acknowledgements

Credits goes to nix and GNU Guix for showing the way.

Copyright

Copyright (C) Amirouche Boubekki (2019).

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can’t perform that action at this time.