Skip to content

Repository files navigation

eclpy

Common Lisp for Python, powered by Embeddable Common Lisp (ECL) running as a packaged WebAssembly runtime.

eclpy exposes a cl4py-inspired Lisp API for evaluating Lisp forms, calling functions, accessing packages, and converting common Lisp values to Python values. Normal users can start with eclpy.syntax; heavier users can drop down to explicit SExp trees or the raw EclSession bridge.

The bridge is bidirectional: Lisp code can evaluate Python through ecl-python:py-eval / py-exec, and the automatically loaded PY DSL (eclpy/python.lisp) gives Lisp code a Pythonic object protocol (imports, attributes, calls, operators, context managers) on top of that bridge.

Install

After the package is published to PyPI:

pip install eclpy

The wheel is expected to include the ECL WebAssembly runtime, so normal users do not need a local ECL installation or an Emscripten toolchain.

Quick Start

import eclpy
import eclpy.syntax as L

with eclpy.Lisp() as lisp:
    assert lisp.eval(L.expr(("+", 1, 1))) == 2

See docs/quickstart.md for the syntax API, the command-line REPL, Pythonic package proxies, and the full public API.

Documentation

  • docs/quickstart.md -- install, quick start, CLI, Pythonic proxies, strings/symbols/lists, public API.
  • docs/api-guide.md -- strict SExp evaluation, references, conses, evaluating Python from Lisp, the PY DSL, low-level session API, errors, security model.
  • docs/python-in-lisp.md -- automatically loaded PY DSL for calling Python from Lisp.
  • docs/asdf.md -- loading ASDF and local source systems.
  • docs/swank.md -- SWANK/SLIME server and its WASM sandbox limitations.
  • docs/architecture.md -- module layering and the Python<->Lisp value protocol.
  • docs/development.md -- running tests, building the WASM runtime, building wheels, and building Sphinx docs.
  • docs/api-reference.md -- Sphinx autodoc page for the Python modules.
  • docs/lisp-source.md -- Sphinx literalinclude page for the bundled Lisp runtime and PY DSL source.

Build the Sphinx site locally with:

uv run sphinx-build -b html docs docs/_build/html

License

Copyright (c) 2026 Masaya Taniguchi masaya.taniguchi@tani.cc.

This project uses the same license terms as ECL: GNU LGPL 2.1 or later. See LICENSE for eclpy and ECL copyright notices and COPYING for the LGPL 2.1 text.

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages