ELPS — An embedded Lisp interpreter for Go programs
ELPS (Ellipse) is a Lisp-1 dialect designed to be embedded within Go applications. It provides a standalone CLI for running, linting, formatting, debugging, and exploring ELPS Lisp code.
- Built for embedding. A small Go API creates environments, loads code, and exposes Go functions and packages to Lisp (Embedding Guide).
- Bounded execution. Context cancellation, step limits, stack-height, nesting and tail-iteration limits, and allocation size caps let a host stop runaway programs (Execution Limits).
- Fast per-request VMs. Load a program once, publish an immutable template, and instantiate independent VMs from it (VM Templates).
- Condition-based errors. Typed errors carry stack traces and can be handled in Lisp (
handler-bind,ignore-errors,try,with-cleanup) or returned to Go. - Standard library. Packages for JSON, regular expressions, time, math, strings, base64, schema validation, testing and more.
- Tooling included. REPL, language server, DAP debugger, linter, formatter, minifier and MCP server in one binary.
go install github.com/luthersystems/elps@latestOr build from source:
git clone https://github.com/luthersystems/elps.git
cd elps && makeLaunch an interactive REPL:
$ elps repl
> (+ 3 1)
4
> (defun greet (name) (format-string "Hello, {}!" name))
> (greet "World")
"Hello, World!"
> ^D
Run a program:
$ elps run prog.lisp
Embed in a Go program:
env := lisp.NewEnv(nil)
env.Runtime.Reader = parser.NewReader()
env.Runtime.Library = &lisp.RelativeFileSystemLibrary{}
if err := lisp.GoError(lisp.InitializeUserEnv(env)); err != nil {
log.Fatal(err)
}
if err := lisp.GoError(lisplib.LoadLibrary(env)); err != nil {
log.Fatal(err)
}
res := env.LoadString("main.lisp", `(concat 'string "hello, " "world")`)
if err := lisp.GoError(res); err != nil {
log.Fatal(err)
}
fmt.Println(res) // "hello, world"- VS Code Extension — Syntax highlighting, LSP, debugger (Marketplace)
- Neovim — LSP and DAP configuration
- Emacs — lsp-mode/eglot and dap-mode configuration
- Helix — LSP and DAP configuration
- JetBrains — LSP4IJ configuration (LSP and DAP)
| Command | Description |
|---|---|
elps run file.lisp |
Run a Lisp source file |
elps repl |
Start an interactive REPL |
elps lsp |
Start the Language Server Protocol server |
elps debug file.lisp |
Start the debug adapter (DAP) |
elps lint file.lisp |
Run static analysis |
elps fmt file.lisp |
Format source code |
elps minify file.lisp --map symbols.json |
Minify source and record symbol assignments (details) |
elps analyze file.lisp |
Run performance analysis on source files |
elps doc <query> |
Show function/package documentation |
elps mcp |
Start the MCP server for AI tooling |
- Language Reference
- Embedding Guide
- VM Templates
- Debugging Guide
- LSP Guide
- Editor Setup
- Lint Checks
- Suppressing Lint Diagnostics
- Minifier
- Go API Reference
- SICP Examples — Structure and Interpretation of Computer Programs
- User-Defined Types
- Object-Oriented Dispatch — a small method system built on
deftype - WASM Playground (source)
| Versions | |
|---|---|
| Affected | v1.62.0 – v1.75.2 |
| Fixed | v1.75.3 (#821) |
On an affected version, a thread step whose head is a macro or special
operator, such as default, when, and, or or your own macro, fails at
run time:
(thread-last x (default 0) (+ 1))
;; error: lisp:thread-last: thread step is not a regular function: #<builtin>v1.61 and earlier accept these steps. Remedy: upgrade to v1.75.3 or later.
On an affected version, use a regular function as the step instead, for
example (defun default-to (v d) (if (nil? v) d v)) and
(thread-last x (default-to 0) (+ 1)).
From v1.75.3, a macro or operator step gets the value as a quoted datum (nil stays nil), so a macro that reads its argument as syntax sees a quoted value, not the expression that made it. See the language guide and #820.
ELPS is released under the BSD 3-Clause License. See CONTRIBUTING.md to get involved.
