Giter Club home page Giter Club logo

cl2nix's Introduction

CL2NIX

CL2NIX is a tool to assist in maintaining Common Lisp in Nix.

Motivation

Currently (December, 2021), the support for Common Lisp in Nixpkgs is far from perfect:

  1. Quicklisp is used. I do like Quicklisp and I am very thankful to its creator for making Common Lisp system distribution easy and maintaining the dist. However, in the case of Nix, we already have a package manager.
  2. Generating dists with Quicklisp can interfere with local Quicklisp installation.
  3. The generator tool only works inside of a nix-shell, providing build dependencies for the systems being checked. Do we actually have to build everything before resolving lisp dependencies? We will find out later.
  4. Adding new lisp systems to Nixpkgs is unintuitive. Nix-shells make this worse, when there is a system missing from Nixpkgs, because we are forced to define lisp dependencies by hand if they are missing as well.
  5. Lisp compilers miss the withPackages option, that, for example, GHC and Python have. Every lisp system is isolated in the store and collected for the compiler by the clwrapper script. As it seems to me, this breaks the rules that exist for other languages.

Goals

  1. CL2NIX should only depend on ASDF.
  2. CL2NIX should be able to:
    1. Generate a package expression:
      1. Read a system description in quicklisp-projects format
      2. Prefetch the system, save its URL, revision and sha256 sum
      3. Find the system’s .asd files, read them, extract the defined system names and lisp dependencies for each system
      4. Use the gathered information to generate a lisp package expression for Nix
    2. Generate an attrset for lisp packages:
      1. Read a list of system descriptions in quicklisp-projects format
      2. Check that lisp dependencies are satisfied, warn if not and log the missing systems
      3. Generate and collect expressions, then save to a file

The nix expression should allow for overrides to provide external build- and runtime dependencies. If an attrset is created, overrides are written by hand in quicklisp-to-nix-overrides.nix manner.

New wrappers should be written to allow for intuitive lisp usage with Nix (withPackages). Hopefully, we will be able to reuse the compiler definitions from Nixpkgs. It may also be viable to create different attrsets for different compilers.

Broken lisp packages should be marked.

Other ways to run Common Lisp with Nix(OS) that I tried

  1. Quicklisp:
    • Familiar
    • Nix-shells still need to be written (for Roswell also)
  2. Roswell:
    • Familiar
    • Not really sure if .ros scripts work right
    • The installation process is unreliable. For me manually changing the config file worked on one machine, but on the other one it was resetting
  3. Ql2nix:
    • Builds an environment with lisp systems, which are not isolated
    • When I tried it, there were systems that it could not build
    • Minor changes in nix-shell required to rebuild the entire environment

    I did not track the project for quite some time, things may have changed.

  4. cl-nix-project-skeleton was my attempt to reuse the facilities available in Nixpkgs to build a nix-shell. It is a mess, but it gave me some insights

Source descriptions

Apparently some descriptions in the quicklisp-projects repository are outdated, so check also cldm-repo.

Single-file libraries

Output paths should be collected and put into an environment variable (NIX_SINGLE_FILE_SYSTEMS).

Lisp compiler needs to get a function to find single-file libraries through NIX_SINGLE_FILE_SYSTEMS. The function symbol is put into *MODULE-PROVIDER-FUNCTIONS*.

This is not required for ASDF systems, as those are already managed by ASDF and CL_SOURCE_REGISTRY.

cl2nix's People

Contributors

teu5us avatar uthar avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.