Skip to content
luthersystemsPublic

About

An embedded lisp interpreter

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

36 stars

Watchers

3 watching

Forks

Latest commit

 

History

2,063 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ELPS — Embedded Lisp Interpreter

ELPS — An embedded Lisp interpreter for Go programs

Go Reference CI Tests License: BSD-3-Clause Discord


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.

Why ELPS

  • 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.

Install

go install github.com/luthersystems/elps@latest

Or build from source:

git clone https://github.com/luthersystems/elps.git
cd elps && make

Quick Start

Launch 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"

Editor Support

CLI

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

Documentation

Examples

Known Issues

thread-first / thread-last refuse a macro or special operator step

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.

Community

ELPS is released under the BSD 3-Clause License. See CONTRIBUTING.md to get involved.

About

An embedded lisp interpreter

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

36 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages