# ICL - Interactive Common Lisp
[](https://github.com/atgreen/icl/actions/workflows/ci.yaml)
[](https://github.com/atgreen/icl/releases/latest)
[](https://opensource.org/licenses/MIT)
[](https://github.com/atgreen/icl/releases)
ICL is an enhanced REPL for Common Lisp. It provides a modern interactive experience with readline-style editing, persistent history, tab completion, and an extensible command system. ICL works in your terminal, in a web browser with package browsing and data visualization, or integrated with Emacs via SLY/SLIME.
## Terminal REPL
*Syntax highlighting, paren matching, tab completion, paredit mode, and interactive inspector*
## Browser REPL
*Package browser, symbol inspector, data visualization, and class hierarchy graphs*
## Flame Graph Profiling
*Interactive Speedscope flame graphs for performance profiling (SBCL only)*
Profile any expression with `,flame` and explore the results in an interactive [Speedscope](https://www.speedscope.app/) visualization. Switch between Time Order, Left Heavy, and Sandwich views to identify performance bottlenecks.
## Features
- **Syntax highlighting** - Colorized input with distinct colors for keywords, strings, comments, numbers, and symbols
- **Parenthesis matching** - Real-time highlighting of matching parentheses as you type
- **Paredit mode** - Structural editing with auto-close parens, safe deletion, and sexp navigation
- **Multi-line input** - Automatically detects incomplete expressions with smart indentation
- **Persistent history** - Command history saved across sessions
- **Tab completion** - Complete symbols, package-qualified names, and keywords
- **Command system** - Built-in commands prefixed with comma (e.g., `,help`)
- **Multiple Lisp support** - Works with SBCL, CCL, ECL, CLISP, ABCL, Clasp, and Roswell
- **Error backtraces** - Automatic backtrace capture with `,bt` command to view stack traces
- **Thread inspection** - List and inspect threads in the inferior Lisp
- **Documentation lookup** - Quick access to function docs and apropos search
- **Interactive object inspector** - TUI for exploring objects with keyboard navigation
- **Tracing** - Enable/disable function tracing
- **Source location** - Find where functions are defined
- **Terminal-aware colors** - Automatically detects light/dark terminal background
- **AI integration** - Use `,explain` to get AI-powered explanations of code, errors, and results
- **Browser interface** - Web UI with package browser, symbol list, inspector, and xterm.js terminal
- **Data visualization** - Visualize hash tables, classes, sets, SVG, HTML, JSON, Vega-Lite charts, Mermaid diagrams, and function disassembly
- **Custom visualizations** - Define `icl-runtime:visualize` methods for your own classes
- **Flame graph profiling** - Interactive Speedscope visualizations for performance analysis (SBCL)
- **Emacs integration** - Works with SLY/SLIME for synchronized browser visualization
## Installation
### Pre-built Binaries
Download from [GitHub Releases](https://github.com/atgreen/icl/releases):
| Platform | Formats |
|----------|---------|
| Linux | RPM, DEB |
| Windows | ZIP, EXE installer, MSI installer |
[Roswell](https://roswell.github.io/) users can also install with `ros install atgreen/icl`.
### Building from Source
```sh
git clone https://github.com/atgreen/icl.git
cd icl
ocicl install
make
```
Requires SBCL, [ocicl](https://github.com/ocicl/ocicl), and libfixposix-devel.
## Usage
Start ICL (auto-detects available Lisp):
```sh
icl
```
Specify a Lisp implementation:
```sh
icl --lisp ccl
icl --lisp ecl
icl --lisp roswell # Use Roswell's managed environment
```
Evaluate an expression and exit:
```sh
icl -e '(+ 1 2 3)'
```
Load a file before starting the REPL:
```sh
icl -l init.lisp
```
Connect to an existing Slynk server:
```sh
icl --connect localhost:4005
```
Skip loading config file:
```sh
icl --no-config
```
Start with browser interface (opens IDE alongside terminal REPL):
```sh
icl -b
```
## Emacs Integration
ICL ships an Emacs helper for SLY or SLIME that launches the browser REPL and
syncs visualizations with evals.
Minimal setup (adjust the path for your install):
```elisp
(add-to-list 'load-path "/path/to/icl")
(require 'icl)
```
Commands:
- `M-x icl` — start ICL browser connected to the current SLY/SLIME session
- `M-x icl-stop` — stop the ICL process
- `M-x icl-restart` — restart ICL
If you have both SLY and SLIME installed, ICL prefers SLY by default.
You can override this:
```elisp
(setq icl-backend 'slime) ;; or 'sly or 'auto
```
If you install the package via RPM/DEB/Windows installer, the Emacs
files are placed in a standard site-lisp directory and you can just
`(require 'icl)`.
### Packaging Notes (RPM/DEB/Windows)
Suggested install locations for Emacs files:
- RPM: `%{_datadir}/emacs/site-lisp/icl/icl.el` and `icl-autoloads.el`
- DEB: `/usr/share/emacs/site-lisp/icl/icl.el` and `icl-autoloads.el`
- Windows: `/share/emacs/site-lisp/icl/icl.el` and `icl-autoloads.el`
For packaging, include `icl-autoloads.el` and add the site-lisp path to
Emacs’ `load-path` (via site-start.d or the installer), then users can:
```elisp
(require 'icl)
```
## Commands
Commands are prefixed with a comma. Type `,help` for a full list.
### Navigation
| Command | Description |
|---------|-------------|
| `,cd ` | Change current package |
| `,pwd` | Show current package |
| `,ls [filter]` | List symbols (filters: functions, macros, variables, classes) |
### Documentation
| Command | Description |
|---------|-------------|
| `,doc ` | Show documentation |
| `,describe ` | Full description of symbol |
| `,apropos ` | Search for matching symbols |
| `,arglist ` | Show function arguments |
| `,source ` | Show source location |
| `,edit ` | Open source in `$EDITOR` (alias: `,ed`) |
### Cross-Reference (Xref)
| Command | Description |
|---------|-------------|
| `,callers ` | Show functions that call symbol (alias: `,xc`) |
| `,callees ` | Show functions called by symbol (alias: `,xe`) |
| `,references ` | Show code that references variable (alias: `,xr`) |
### Inspection
| Command | Description |
|---------|-------------|
| `,inspect ` | Interactive object inspector (alias: `,i`) |
| `,i` | Inspect last result (`*`) |
| `,inspect-static ` | Non-interactive inspection output |
| `,slots ` | Show slots of a class instance |
The interactive inspector (`,i` or `,inspect`) provides a TUI for exploring objects:
| Key | Action |
|-----|--------|
| `↑`/`↓` or `j`/`k` | Navigate entries |
| `Enter` | Drill into selected entry |
| `b` or `Backspace` | Go back to parent object |
| `q` or `Escape` | Quit inspector |
### Macros
| Command | Description |
|---------|-------------|
| `,macroexpand