Skip to content

Instantly share code, notes, and snippets.

View yitzchak's full-sized avatar

Tarn W. Burton yitzchak

  • Georgia, United States
  • 17:58 (UTC -04:00)
View GitHub Profile

Common Lisp Progamming Rules

Much of the wisdom of Common Lisp has been lost and left to be rediscovered by new generations of programmers. The following "rules" have not been lost to time, though.

  • Greenspun's Tenth Rule: Any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp.
  • Strandh's Thirteenth Rule: There is no limit to the time nor energy that many programmers are willing to spend to avoid learning Common Lisp.
  • Burton's Eighteenth Rule: Every Lisp programmer will be tempted to create their own iteration facilty that has neligible new features and immeasurable new flaws when compared to Common Lisp's LOOP.
Test CLASP non-bytecode CLASP bytecode ECL non-bytecode ECL bytecode
PROCLAIM.ERROR.3 X
PROCLAIM.ERROR.4 X
PROCLAIM.ERROR.5 X
PROCLAIM.ERROR.6 X
PROCLAIM.ERROR.7 X
PROCLAIM.ERROR.8 X
PROCLAIM.ERROR.9 X
PROCLAIM.ERROR.10
@yitzchak
yitzchak / feature-cleanup.md
Created October 24, 2022 20:12
Feature cleanup in Clasp
@yitzchak
yitzchak / groveler.lisp
Last active June 17, 2022 10:46
ASDF groveler
;;;; This ASDF groveler does not use ASDF's own operation framework because
;;;; it does not need the systems to be loaded or compiled. It is possible
;;;; to do some introspection of ASDF systems via the ASDF perform methods,
;;;; but ASDF assumes that the systems will be loaded into the host
;;;; implementation. In other words, the ASDF3 feature expressions will use
;;;; CL:*FEATURES*, but overriding CL:*FEATURES* will result in ASDF
;;;; attempting to load and compile the system being introspected with those
;;;; features leading to disastrous results.
;;;;
;;;; Instead, we walk the dependency/child component graph ourselves and
@yitzchak
yitzchak / Dockerfile
Last active June 2, 2022 18:21
CANDO user install
FROM ubuntu:jammy
SHELL ["/bin/bash", "-c"]
ARG D_USER=app
ARG D_UID=1000
ENV DEBIAN_FRONTEND=noninteractive
ENV USER ${D_USER}
ENV HOME /home/${D_USER}
@yitzchak
yitzchak / diff.lisp
Last active May 11, 2022 18:22
diff
;; Ran this on Mac without the exceptions in clasp_islower_wide and clasp_isupper_wide
(defvar q (sort #< (remove-duplicates (append (loop for i from 0 below (min 65536 char-code-limit)
for x = (code-char i)
unless (or (not x)
(let ((u (char-upcase x)))
(and (or (lower-case-p x) (eqlt u x))
(eqlt u (char-upcase u)))))
collect i)
(loop for i from 0 below (min 65536 char-code-limit)
for x = (code-char i)
@yitzchak
yitzchak / clasp-cl-git.rb
Last active May 10, 2022 20:27
Clasp Formula (git)
class ClaspCl < Formula
desc "Common Lisp implementation that brings Common Lisp and C++ together"
homepage "https://github.com/clasp-developers/clasp"
url "https://github.com/clasp-developers/clasp.git",
using: :git,
branch: "main"
version "1.0.0"
sha256 ""
license "GPL-2.0-or-later"
head "https://github.com/clasp-developers/clasp.git"
@yitzchak
yitzchak / cando-git.rb
Last active May 10, 2022 20:26
Cando Formula (git)
class CandoGit < Formula
desc "Cando chemisty and Common Lisp implementation that brings Common Lisp and C++ together"
homepage "https://github.com/clasp-developers/clasp"
url "https://github.com/clasp-developers/clasp.git",
using: :git,
branch: "main"
version "1.0.0"
sha256 ""
license "GPL-2.0-or-later"
@yitzchak
yitzchak / cando.rb
Last active May 10, 2022 20:27
Cando Formula
class Cando < Formula
desc "Cando chemisty and Common Lisp implementation that brings Common Lisp and C++ together"
homepage "https://github.com/clasp-developers/clasp"
url "https://github.com/clasp-developers/clasp/archive/refs/heads/main.tar.gz"
version "1.0.0"
sha256 "d0bbebb1f885ad353e69d77f3d8297869d598e2619acebed9daf61c47385e150"
license "GPL-2.0-or-later"
depends_on "boost" => :build
depends_on "libunwind-headers" => :build
@yitzchak
yitzchak / clasp-cl.rb
Last active May 10, 2022 20:27
Clasp Formula
class ClaspCl < Formula
desc "Common Lisp implementation that brings Common Lisp and C++ together"
homepage "https://github.com/clasp-developers/clasp"
url "https://github.com/clasp-developers/clasp/archive/refs/heads/main.tar.gz"
version "1.0.0"
sha256 "2da3a418bce90fecaca0c510f8d0fb804c661d1676e963ca11ada2c1eeea7327"
license "GPL-2.0-or-later"
head "https://github.com/clasp-developers/clasp.git"
depends_on "boost" => :build