How to manage shared lisp dependencies?

What is the lisp equivalent of the requirement file, ruby ​​gemfile, node package.json, etc.? I'm not quite sure how asdf and quicklisp relate if these are the right things to use.

+6
source share
4 answers

The .asd file is a requirements file. Use quicklisp to set requirements.

Use ASDF to define "system." Create the my-system.asd .

 (asdf:defsystem #:my-system :serial t :description "Describe my-system here" :author "My Name < my.name@example.com >" :license "Specify license here" :depends-on (#:hunchentoot #:cl-who) :components ((:file "package") (:file "dispatch"))) 

This creates a system called #: my-system. I'm not really sure what # means, since I saw the system definitions without it in the source code. Only the first line is required. :depends-on tells ASDF to load other systems before this new system definition is processed. In this case, it loads #:hunchentoot and #:cl-who . :components upload specific files. package.lisp and dispatch.lisp . :serial t reports that it loads it in order. This is important if you say that dispatch.lisp depends on something in package.lisp , so you need to download package.lisp .

Use quicklisp to download and install dependencies in :depends-on . Running (ql:quickload "my-system") .

I did not see any signs of version control.

+3
source

First of all, pip requirements.txt very different from rubygem or node package.json : the former only indicates dependencies, while the latter describes the package, including its dependencies.

Python pip actually also relies on a similar package description format called eggs.

The pretty direct equivalent of rubygem is the ASDF defsystem form, usually placed in the <system-name>.asd ("system" is the Lisp term for what might be called a package, module or library in other languages ​​- see here for a more detailed explanation )

Two main differences:

  • ASDF also allows you to specify how to build (as well as load, verify, etc.) a system (somewhat equivalent to a make file) - AFAIK, there is no such thing in rubygems or node in general

    / li>
  • Unlike gems or node, ASDF does not provide a mechanism for downloading and installing the package. This is where quicklisp comes quicklisp - it deals with retrieving ASDF systems. But ql is not the only way: historically there were other approaches to installing ASDF libraries, including ASDF-Install and clbuild , and others may appear in the future

+1
source

Qlot

For a relationship with ASDF and Quicklisp, other answers give a good approach.

I want to note that now you can use the general lisp library, very similar to the ones indicated, which are available in quicklisp an, Qlot . It is used to indicate local dependencies of a project. This is very similar to bundle and gemfile in ruby.

Quicklisp Packages

Also in 2015-04-28 you can use quicklisp bundles. Quicklisp library packages are stand-alone collections of systems that are exported from Quicklisp and loaded without using Quicklisp.

+1
source

There is no one-to-one equivalent mentioned above. However, the combination of ASDF + Quicklisp is pretty close.

With ASDF, you define your systems (modules, if you want) - packing your lisp files in a consistent way, and you declare your dependencies. Quicklisp is an online source repository for these systems. When you boot the system using Quicklisp, it downloads these dependencies and downloads them for you.

Now I'm not sure if there is something like a version ..

0
source

Source: https://habr.com/ru/post/957153/


All Articles