CIEL
CIEL Is an Extended Lisp. Scripting with batteries included.
Install / Use
/learn @ciel-lang/CIELREADME
CIEL Is an Extended Lisp
STATUS: ~~highly~~ WIP, the API WILL change, but it is usable.
I am dogfooding it in public and private projects.
What is this ?
CIEL is a ready-to-use collection of libraries.
It's Common Lisp, batteries included.
It comes in 3 forms:
- a binary, to run CIEL scripts: fast start-up times, standalone image, built-in utilities.
- a simple full-featured REPL for the terminal.
- a Lisp library and a core image.
Questions, doubts? See the FAQ.
NEW: we now have a Docker file.
#!/usr/bin/env ciel
(-> "https://fakestoreapi.com/products?limit=5"
http:get
json:read-json
(elt 0)
(access "title"))
$ chmod +x getproduct.lisp
$ time ./getproduct.lisp
"Fjallraven - Foldsack No…ckpack, Fits 15 Laptops"
./getproduct.lisp 0.10s user 0.02s system 24% cpu 0.466 total
Rationale
One of our goals is to make Common Lisp useful out of the box for mundane tasks -by today standards. As such, we ship libraries to handle JSON or CSV, as well as others to ease string manipulation, to do pattern matching, to bring regular expressions, for threads and jobs scheduling, for HTTP and URI handling, and so on. You can of course do all this without CIEL, but then you have to install the library manager first and load these libraries into your Lisp image every time you start it. Now, you have them at your fingertips whenever you start CIEL.
We also aim to soften the irritating parts of standard Common Lisp. A
famous one, puzzling for beginners and non-optimal for seasoned lispers,
is the creation of hash-tables. We include the dict function from the
Serapeum library (which we enhanced further with a pull request):
CIEL-USER> (dict :a 1 :b 2 :c 3)
which prints:
(dict
:A 1
:B 2
:C 3
)
In standard Common Lisp, the equivalent is more convoluted:
(let ((ht (make-hash-table :test 'equal)))
(setf (gethash :a ht) 1)
(setf (gethash :b ht) 2)
(setf (gethash :c ht) 3)
ht)
;; #<HASH-TABLE :TEST EQUAL :COUNT 3 {1006CE5613}>
;; (and we don't get a readable representation, so our example is not even equivalent)
Moreover, we bring:
- a full featured REPL on the terminal and
- scripting capabilities, see more below.
See the documentation.
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->Table of Contents
- CIEL Is an Extended Lisp
- Install
- Build
- Usage
- Libraries
- Language extensions
- Final words
- Misc: how to generate the documentation
- Contributors
- Lisp?!
Install
Download a binary. For scripting and the custom REPL.
Getting a binary allows you to run scripts, to play around in its terminal readline REPL. A binary doesn't allow you to use CIEL in your existing Common Lisp editor (which still offers the most interactive and fast development experience).
To download a CIEL binary:
- check our releases on https://github.com/ciel-lang/CIEL/releases/
- we provide a binary from a CI for some systems: go to
https://gitlab.com/vindarel/ciel/-/pipelines, download the latest
artifacts, unzip the
ciel-v0-{platform}.ziparchive and runciel-v0-{platform}/ciel.
CIEL is currently built for the following platforms:
| Platform | System Version (release date) | |----------|-------------------------------| | Debian x86-64 | Debian Buster (2019) | | void | Void Linux glibc (2023-05), using cinerion's Docker image |
Start it with ./ciel.
With no arguments, you enter CIEL's terminal REPL.
You can give a CIEL script as first argument, or call a built-in one. See the scripting section.
Build
To build CIEL, both the binary and the core image, you need a couple system dependencies and you have to check a couple things on the side of lisp before proceeding.
Implementations support:
- CIEL is primarily developed and tested with SBCL.
- it was reported (thanks fosskers) to compile on CCL.
- ECL, ABCL and Allegro got issues.
- LispWorks: cannot test due to the free version limitations. You're welcome to offer me a licence :)
Dependencies
System dependencies
You will probably need the following system dependencies (names for a Debian Bullseye system):
zlib1g-dev # from deploy for SBCL < 2.2.6
If your SBCL version is >= 2.2.6 you might want to use the more
performant libzstd-dev library instead of zlib1g-dev.
libzstd-dev # from deploy for SBCL >= 2.2.6
On Linux:
inotify-tools
On MacOS:
fsevent
You can run: make debian-deps or make macos-deps.
ASDF >= 3.3.4 (local-nicknames)
ASDF is the de-facto system definition facility of Common Lisp, that lets you define your system's metadata (author, dependencies, sources, modules…).
Please ensure that you have ASDF >= 3.3.4. It is for instance not the case with SBCL 2.2.9.
Ask the version with our script:
$ make check-asdf-version
or yourself with(asdf:asdf-version) on a Lisp REPL, or with
this one-liner from a terminal:
$ sbcl --eval '(and (print (asdf:asdf-version)) (quit))'
Here's a one-liner to update ASDF:
$ mkdir ~/common-lisp/
$ ( cd ~/common-lisp/ && wget https://asdf.common-lisp.dev/archives/asdf-3.3.5.tar.gz && tar -xvf asdf-3.3.5.tar.gz && mv asdf-3.3.5 asdf )
Install Quicklisp
To build CIEL on your machine, you need the Quicklisp library manager. Quicklisp downloads and installs a library and its dependencies on your machine. It's very slick, we can install everything from the REPL without restarting our Lisp process. It follows a "distrubution" approach, think Debian releases, where libraries are tested to load.
It isn't the only library manager nowadays. See https://github.com/CodyReichert/awesome-cl#library-manager.
Install it:
curl -O https://beta.quicklisp.org/quicklisp.lisp
sbcl --load quicklisp.lisp --eval "(quicklisp-quickstart:install)" --quit
sbcl --load ~/quicklisp/setup.lisp --eval "(ql:add-to-init-file)" --quit
It creates a ~/quicklisp/ directory. Read its installation instructions to know more.
Install our Lisp dependencies [MANDATORY]
One library that we use is not included in Quicklisp (as of <2025-02-03>), termp. It is a small and trivial library, you can clone it into your ~/quicklisp/local-projects:
git clone https://github.com/vindarel/termp/ ~/quicklisp/local-projects/termp
For a number of other libraries we need the Quicklisp version of August, 2024, or later.
For those, you should either:
- ensure that your Quicklisp version is recent enough (with
(ql:dist-version "quicklisp")) and maybe update it (with(ql:update-dist "quicklisp")) - clone our dependencies locally with the command below.
If you need it, clone all the required dependencies into your ~/quicklisp/local-projects/ with this command:
make ql-deps
NB: other tools exist for this (Qlot, ocicl…), we are just not using them yet.
How to load CIEL with Quicklisp
You need the dependencies above: Quicklisp, a good ASDF version, our up-to-date Lisp dependencies.
This shows you how to load CIEL and all its goodies, in order to use it in your current editor.
CIEL is not on Quicklisp yet, but it is on Ultralisp.
So, either clone this repository:
git clone https://github.com/ciel-lang/CIEL ~/quicklisp/local-projects/CIEL
or install the Ultralisp distribution and pull the library from there:
(ql-dist:install-dist "http://dist.ultralisp.org/" :prompt nil)
Now, in both cases, you can load the ciel.asd file (with asdf:load-asd
or C-c C-k in Slime) and quickload "ciel":
CL-USER> (ql:quickload "ciel")
be sure to enter the ciel-user package:
(in-package :ciel-user)
you now have access to all CIEL's packages and functions.
How to build a CIEL binary and a core image
You need the dependencies above: Quicklisp, a good ASDF version, our up-to-date Lisp dependencies.
To build CIEL's binary, use:
$ make build
This create
