Skip to content

Instantly share code, notes, and snippets.

@sebastiancarlos
Last active March 26, 2025 01:27
Show Gist options
  • Save sebastiancarlos/c38ad24460a85b7a222664f6f65ea279 to your computer and use it in GitHub Desktop.
Save sebastiancarlos/c38ad24460a85b7a222664f6f65ea279 to your computer and use it in GitHub Desktop.
Count number of quicklisp system dependencies. Results (2025-03): https://gist.github.com/sebastiancarlos/e2e94031f676ddf4bd619cb7f932b6b0
; All my gist code is licensed under the MIT license.
(defun count-quicklisp-dependencies ()
"Count the number of times each system is used as a dependency in Quicklisp."
(let ((system-list-names (sort (mapcar #'ql-dist::name (ql:system-list))
#'string<))
(file "/tmp/deps.csv"))
(with-open-file (out file
:direction :output
:if-exists :supersede
:if-does-not-exist :create)
(dolist (sys system-list-names)
(let ((deps (ql:who-depends-on sys)))
(format out "~A,~A,~{'~A'~^ ~}~%" sys (length deps) deps))))
(uiop:run-program (format nil "sort -n -r -t, -k2,2 -o ~A ~A" file file))
(uiop:run-program (format nil "sed -i '1i system,uses,used-by' ~A" file))
(format nil "Wrote ~A" file)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment