Sign inSign up

clfoundation/clasp

By clfoundation

Updated about 2 months ago

Clasp Common Lisp

Image
0

2.5K

clfoundation/clasp repository overview

Supported Tags

Simple Tags

  • 0.4.3 0.4.3-buster
  • 1.0.0 1.0.0-bookworm
  • 2.7.0 2.7.0-bookworm 2.7.0-bookworm-slim 2.7.0-trixie 2.7.0-trixie-slim

Shared Tags

  • latest
    • 2.7.0

Quick Reference

Clasp Home Page
https://clasp-developers.github.io

Where to file Docker image related issues
https://gitlab.common-lisp.net/cl-docker-images/clasp

Where to file issues for Clasp itself
https://github.com/clasp-developers/clasp/issues

Maintained by
CL Docker Images Project

Supported platforms
linux/amd64

What is Clasp?

From Clasp's Home Page:

Clasp is a new Common Lisp implementation that seamlessly interoperates with C++ libraries and programs using LLVM for compilation to native code. This allows Clasp to take advantage of a vast array of preexisting libraries and programs, such as out of the scientific computing ecosystem. Embedding them in a Common Lisp environment allows you to make use of rapid prototyping, incremental development, and other capabilities that make it a powerful language.

How to use this image

Create a Dockerfile in your Clasp project

FROM clfoundation/clasp:latest
COPY . /usr/src/app
WORKDIR /usr/src/app
CMD [ "clasp", "-l", "./your-daemon-or-script.lisp" ]

You can then build and run the Docker image:

\$ docker build -t my-clasp-app .
\$ docker run -it --rm --name my-running-app my-clasp-app

Run a single Common Lisp script

For many simple, single file projects, you may find it inconvenient to write a complete `Dockerfile`. In such cases, you can run a Lisp script by using the Clasp Docker image directly:

\$ docker run -it --rm --name my-running-script -v "\$PWD":/usr/src/app -w /usr/src/app clfoundation/clasp:latest clasp -l ./your-daemon-or-script.lisp

Developing using SLIME

SLIME provides a convenient and fun environment for hacking on Common Lisp. To develop using SLIME, first start the Swank server in a container:

\$ docker run -it --rm --name clasp-slime -p 127.0.0.1:4005:4005 -v /path/to/slime:/usr/src/slime -v "\$PWD":/usr/src/app -w /usr/src/app clfoundation/clasp:latest clasp -l /usr/src/slime/swank-loader.lisp -e '(swank-loader:init)' -e '(swank:create-server :dont-close t :interface "0.0.0.0")'

Then, in an Emacs instance with slime loaded, type:

M-x slime-connect RET RET RET

What's in the image?

This image contains Clasp binaries built from the latest source code released by the Clasp developers for a variety of OSes.

Clasp is built using the Boehm-Weiser garbage collector (boehmprecise variant) and uses LLVM 19 for code generation.

Image Variants

clfoundation/clasp:<version>

This is the defacto image. It is based on buildpack-deps and includes a variety of useful tools for development.

clfoundation/clasp:<version>-slim

This image is based on debian and does not contain the common packages contained in the default tag. It includes only the minimal packages needed to run clasp.

A note on Alpine

There are currently no Alpine-based images. Clasp requires glibc's execinfo.h backtrace facility; its alternative libunwind code path (USE_LIBUNWIND) is not wired up in released versions, so musl-based systems such as Alpine are not yet supported upstream.

Quicklisp

All images come with a script to easily install Quicklisp. To install it, simply run install-quicklisp as a shell command. It will download and verify the quicklisp bootstrapping code and install it into ~/.quicklisp. To load Quicklisp in your Lisp session, you need to run:

(load "~/.quicklisp/setup.lisp")

To load Quicklisp on every start of Clasp, you need to run:

(ql:add-to-init-file)

Full Quicklisp documentation is available at https://www.quicklisp.org.

Building and Contributing

For information on building these images and contributing, please see the repository at https://gitlab.common-lisp.net/cl-docker-images/clasp.

License

Clasp itself is licensed under the LGPL 2.1. The Dockerfiles and build infrastructure are licensed under the BSD 2-Clause License. See the LICENSE file in the repository for details.

Tag summary

Content type

Image

Digest

sha256:248d60c3c

Size

955.6 MB

Last updated

about 2 months ago

docker pull clfoundation/clasp