What's the lisp equivalent of a pip requirement file, ruby gemfile, node package.json, etc? I'm not entirely sure how asdf and quicklisp relate if those are the proper things to use.
A .asd file is a requirements file. Use quicklisp to install requirements.
Use ASDF to define a "system". Create a my-system.asd
file.
(asdf:defsystem #:my-system
:serial t
:description "Describe my-system here"
:author "My Name <[email protected]>"
:license "Specify license here"
:depends-on (#:hunchentoot
#:cl-who)
:components ((:file "package")
(:file "dispatch")))
This creates the system named #:my-system. I'm not actually sure what the # denotes as I've seen system definitions without it in 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
load specific files. package.lisp
and dispatch.lisp
are loaded. :serial t
tells it to load it in order. This is important if say dispatch.lisp
depends on something in package.lisp
such that package.lisp
needs to be loaded first.
Use quicklisp to download and install the dependencies in :depends-on
. Run
(ql:quickload "my-system")
.
I haven't seen any sign of versioning.
First of all, pip's requirements.txt
is very different from rubygem or node's package.json
: the former specifies just the dependencies, while the latter ones describe the package, including its dependencies.
Python's pip
actually also relies on the similar package description format which is called "eggs".
A pretty much direct equivalent of a rubygem is ASDF defsystem
form, usually placed in a file <system-name>.asd
("system" is the Lisp's term for what may be called package, module or library in other languages - see here for a more detailed explanation).
The two major differences are:
ASDF also allows to specify how to build (and also load, test etc) the system (somewhat equivalent to a makefile) — AFAIK, there's no such notion in rubygems or node whatsoever
Unlike gems or node, ASDF doesn't provide a mechanism to download and install the package. This is where quicklisp
comes in — it deals with fetching ASDF systems. But ql
is not the only way here: historically there were other approaches for installing ASDF libraries, including ASDF-Install
and clbuild
, and others may come up in the future
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With