Posts tagged ccl

Common Lisp: CCL on a raspberry pi

posted on 2015-04-28 00:12:21

A raspberry is n ARM-architecture based processor. Usually my common lisp implementation of choice is SBCL / Steel Bank Common Lips, but for ARM CCL / Clozure Common Lisp might be a better fit.

According to some sources on the internet, this is due to CCL's native threadingsupport.

download & compile & install

Head over to and copy the download link.

wget <download-link>
tar xzvf ccl-<...>.tar.gz
mv ccl-<...> /usr/local/src
cd /usr/local/src/ccl/lisp-kernel/linuxarm
# uncomment FLOAT_ABI_OPTION = -mfloat-abi=hard and save, quit
make clean && make
ls -s /usr/local/src/ccl/armcl /usr/local/bin/armcl

Now you should have running armcl binary, which is at the right position according to the FHS (Filesystem Hierarchy Standard) and can be run from anywhere of your shell.

install quicklisp

cd /usr/local/src
curl > quicklisp.lisp
(load "quicklisp.lisp")

Then vi ~/.ccl-init.lisp and wrap the generated code within (defun load quicklisp () ... ). That way you have an easy to call function if you really need ql loaded ((load-quicklisp) will do in the interpreter.), but initial startup is faster. This and the float config trick is something I found at, thanks to Rainer Joswig.

quicklisp help

These might be helpful:

(ql:system-apropos '<string>)
(ql:who-depends-on '<string>)

Scripting in Common Lisp

posted on 2014-06-15 16:41:05

To use Common Lisp for scripts, there exist two approaches, depending on the common lisp implementation you use. The approaches for SBCL and CCL will be shown here, as these seem to be the most widely used ones.

  1. Either create an executable file just like you would for a bash script, and set to the shebang accordingly.
  2. Or create a sh script with an exec line, which in turn will call your lisp file, as a wrapper.
  3. You could as well just create a compiled executable.

on approach 1: SBCL / Steel Bank Common Lisp

The first one will work with SBCL / Steel Bank Common Lisp and some others, but not all implementations:

#!/usr/local/bin/sbcl --script

It's just the path to the executable binary, followed by the --script parameter. This line is put at the top of the executable file containing your common lisp code.

on approach 2: CCL / Clozure Common Lisp

touch run-lisp
chmod a+x run-lisp
vim run-lisp

Wrapper file content:

ccl64 --no-init --terminal-encoding utf-8 --load $1.lisp --eval '(ccl:quit)'

Save, quit.

Put the wrapper somewhere where it will be referenced via the $PATH variable, so you can call it from everywhere.

The wrapper will then be called for running the lisp file in question via run-lisp </path/to/script>/<scriptname>.<ext>.

I.e. run-lisp ./helloworld.lisp.

on approach 3: create an self-sustained executable in SBCL

;; Make an executable Lisp image.  Execute with ./lisp-image
(save-lisp-and-die #p"lisp-image" :executable t)

More on this can be found here.

This blog covers .csv, .htaccess, .pfx, .vmx, /etc/crypttab, /etc/network/interfaces, /etc/sudoers, /proc, 10.04, 14.04, AS, ASA, ControlPanel, DS1054Z, GPT, HWR, Hyper-V, IPSEC, KVM, LSI, LVM, LXC, MBR, MTU, MegaCli, PHP, PKI, R, RAID, S.M.A.R.T., SNMP, SSD, SSL, TLS, TRIM, VEEAM, VMware, VServer, VirtualBox, Virtuozzo, XenServer, acpi, adaptec, algorithm, ansible, apache, apachebench, apple, applet, arcconf, arch, architecture, areca, arping, asa, asdm, autoconf, awk, backup, bandit, bar, bash, benchmarking, binding, bitrate, blackarmor, blockdev, blowfish, bochs, bond, bonding, booknotes, bootable, bsd, btrfs, buffer, c-states, cache, caching, ccl, centos, certificate, certtool, cgdisk, cheatsheet, chrome, chroot, cisco, clamav, cli, clp, clush, cluster, coleslaw, colorscheme, common lisp, configuration management, console, container, containers, controller, cron, cryptsetup, csync2, cu, cups, cygwin, d-states, database, date, db2, dcfldd, dcim, dd, debian, debug, debugger, debugging, decimal, desktop, df, dhclient, dhcp, diff, dig, display manager, dm-crypt, dmesg, dmidecode, dns, docker, dos, drivers, dtrace, dtrace4linux, du, dynamictracing, e2fsck, eBPF, ebook, efi, egrep, emacs, encoding, env, error, ess, esx, esxcli, esxi, ethtool, evil, expect, exportfs, factory reset, factory_reset, factoryreset, fail2ban, fbsd, fdisk, fedora, file, filesystem, find, fio, firewall, firmware, fish, flashrom, forensics, free, freebsd, freedos, fritzbox, fsck, fstrim, ftp, ftps, g-states, gentoo, ghostscript, git, git-filter-branch, github, gitolite, global, gnutls, gradle, grep, grml, grub, grub2, guacamole, hardware, haskell, hdd, hdparm, hellowor, hex, hexdump, history, howto, htop, htpasswd, http, httpd, https, i3, icmp, ifenslave, iftop, iis, imagemagick, imap, imaps, init, innoDB, innodb, inodes, intel, ioncube, ios, iostat, ip, iperf, iphone, ipmi, ipmitool, iproute2, ipsec, iptables, ipv6, irc, irssi, iw, iwconfig, iwlist, iwlwifi, jailbreak, jails, java, javascript, javaws, js, juniper, junit, kali, kde, kemp, kernel, keyremap, kill, kpartx, krypton, lacp, lamp, languages, ldap, ldapsearch, less, leviathan, liero, lightning, links, linux, linuxin3months, lisp, list, livedisk, lmctfy, loadbalancing, locale, log, logrotate, looback, loopback, losetup, lsblk, lsi, lsof, lsusb, lsyncd, luks, lvextend, lvm, lvm2, lvreduce, lxc, lxde, macbook, macro, magento, mailclient, mailing, mailq, manpages, markdown, mbr, mdadm, megacli, micro sd, microsoft, minicom, mkfs, mktemp, mod_pagespeed, mod_proxy, modbus, modprobe, mount, mouse, movement, mpstat, multitasking, myISAM, mysql, mysql 5.7, mysql workbench, mysqlcheck, mysqldump, nagios, nas, nat, nc, netfilter, networking, nfs, nginx, nmap, nocaps, nodejs, numberingsystem, numbers, od, onyx, opcode-cache, openVZ, openlierox, openssl, openvpn, openvswitch, openwrt, oracle linux, org-mode, os, oscilloscope, overview, parallel, parameter expansion, parted, partitioning, passwd, patch, pct, pdf, performance, pfsense, php, php7, phpmyadmin, pi, pidgin, pidstat, pins, pkill, plasma, plesk, plugin, posix, postfix, postfixadmin, postgres, postgresql, poudriere, powershell, preview, profiling, prompt, proxmox, ps, puppet, pv, pveam, pvecm, pvesm, pvresize, python, qemu, qemu-img, qm, qmrestore, quicklisp, quickshare, r, racktables, raid, raspberry pi, raspberrypi, raspbian, rbpi, rdp, redhat, redirect, registry, requirements, resize2fs, rewrite, rewrites, rhel, rigol, roccat, routing, rs0485, rs232, rsync, s-states, s_client, samba, sar, sata, sbcl, scite, scp, screen, scripting, seafile, seagate, security, sed, serial, serial port, setup, sftp, sg300, shell, shopware, shortcuts, showmount, signals, slattach, slip, slow-query-log, smbclient, snmpget, snmpwalk, software RAID, software raid, softwareraid, sophos, spacemacs, spam, specification, speedport, spi, sqlite, squid, ssd, ssh, ssh-add, sshd, ssl, stats, storage, strace, stronswan, su, submodules, subzone, sudo, sudoers, sup, swaks, swap, switch, switching, synaptics, synergy, sysfs, systemd, systemtap, tar, tcpdump, tcsh, tee, telnet, terminal, terminator, testdisk, testing, throughput, tmux, todo, tomcat, top, tput, trafficshaping, ttl, tuning, tunnel, tunneling, typo3, uboot, ubuntu, ubuntu 16.04, udev, uefi, ulimit, uname, unetbootin, unit testing, upstart, uptime, usb, usbstick, utf8, utm, utm 220, ux305, vcs, vgchange, vim, vimdiff, virtualbox, virtualization, visual studio code, vlan, vmstat, vmware, vnc, vncviewer, voltage, vpn, vsphere, vzdump, w, w701, wakeonlan, wargames, web, webdav, weechat, wget, whois, wicd, wifi, windowmanager, windows, wine, wireshark, wpa, wpa_passphrase, wpa_supplicant, x11vnc, x2x, xfce, xfreerdp, xmodem, xterm, xxd, yum, zones, zsh

Unless otherwise credited all material Creative Commons License by sjas