Spork
Spork is a Lisp hosted on CPython. It compiles to Python AST, interoperates directly with Python libraries, and adds macros, expression-oriented syntax, immutable collections, and project tooling.
Highlights
- Direct access to Python modules and objects—no FFI layer or separate VM.
- Lisp macros and homoiconic syntax.
- Persistent vectors, maps, sets, and related types from
spork-pds. - Pattern matching, destructuring, async/await, protocols, decorators, and Python type annotations.
- Source-mapped tracebacks that point back to
.sporkfiles. - A REPL, nREPL server, LSP server, and project commands in one CLI.
Spork supports CPython 3.10 through 3.14, including free-threaded CPython 3.14.
Installation
Install the CLI in an isolated environment with pipx:
pipx install spork-lang
Use pip when adding Spork to an existing Python environment:
python -m pip install spork-lang
On Linux, macOS, or WSL, the installer script is also available:
curl https://raw.githubusercontent.com/spork-it/spork-lang/refs/heads/main/install.sh | sh
Quick start
Start the REPL:
$ spork
Spork REPL - A Lisp for Python
user> (+ 1 2 3)
6
user> (doall (map inc [1 2 3]))
[2 3 4]
Or create hello.spork:
(defn greet [name]
(fmt "Hello, {}!" name))
(print (greet "Spork"))
Run it with:
$ spork hello.spork
Hello, Spork!
Spork collections are immutable and structurally shared:
(def original {:name "Spork" :version 1})
(def updated (assoc original :version 2))
(print original) ; {:name 'Spork' :version 1}
(print updated) ; {:name 'Spork' :version 2}
Python interoperability
Import Python modules and call them directly:
(ns example
(:require [std.json :as json])
(:import [pathlib :refer [Path]]))
(def path (Path "data.json"))
(print (json.dumps {:path (str path)}))
To import .spork modules from Python, import spork once to install its import hook:
import spork
from my_spork_module import greet
print(greet("Python"))
Spork exposes the separately distributed persistent collections under the spork.pds namespace:
from spork.pds import vec
original = vec(1, 2, 3)
updated = original.conj(4)
See the spork-pds documentation for its Python API, design, and benchmarks.
Projects
Create and run a project:
spork new my-project
cd my-project
spork sync
spork run
A spork.it manifest defines metadata, dependencies, source paths, and the entry point. Libraries can also declare a unified :api; Spork then generates idiomatic package-level Spork and Python APIs, version metadata, generic .pyi stubs, and py.typed from one annotated implementation namespace.
Common commands include:
| Command | Purpose |
|---|---|
spork repl |
Start a project-aware REPL |
spork add / spork remove |
Edit dependencies in the nearest spork.it |
spork sync |
Create the project environment and install dependencies |
spork run |
Run the configured entry point |
spork test |
Discover and run Spork tests |
spork build |
Compile sources to Python in .spork-out/ |
spork dist |
Build a wheel and source distribution |
spork lsp |
Start the language server |
Run spork --help for the complete CLI reference.
Documentation
- Changelog
- Documentation index
- Language reference
- Standard library reference
- Projects and CLI
- Examples
- Emacs mode and Neovim support
spork-pdsAPI, design, and benchmarks
Development
git clone https://github.com/spork-it/spork-lang.git
cd spork-lang
make venv
make test
.venv/bin/python -m pytest
Use make help for development, packaging, and cleanup targets.
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spork_lang-0.4.3.tar.gz.
File metadata
- Download URL: spork_lang-0.4.3.tar.gz
- Upload date:
- Size: 250.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66acc1b4370a465b179251201151d8b86c902a596a62c029c470617192b24b23
|
|
| MD5 |
3f59b302f9174f37f23028515dd35410
|
|
| BLAKE2b-256 |
2549169ff176aefc05c6c1d412bb2a1c2277c2f8cf66a4738c1ed546dd1d0e9e
|
Provenance
The following attestation bundles were made for spork_lang-0.4.3.tar.gz:
Publisher:
build.yml on spork-it/spork-lang
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spork_lang-0.4.3.tar.gz -
Subject digest:
66acc1b4370a465b179251201151d8b86c902a596a62c029c470617192b24b23 - Sigstore transparency entry: 2641820590
- Sigstore integration time:
-
Permalink:
spork-it/spork-lang@7dd047bd370d2f84311719302925673ee288cdfe -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/spork-it
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@7dd047bd370d2f84311719302925673ee288cdfe -
Trigger Event:
push
-
Statement type:
File details
Details for the file spork_lang-0.4.3-py3-none-any.whl.
File metadata
- Download URL: spork_lang-0.4.3-py3-none-any.whl
- Upload date:
- Size: 184.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ffe6d0016db5da94f63eb88b578e5428499c6dc08896155bea4a59c726d34ec
|
|
| MD5 |
c2f1eec14f9b1e780243648e2c4f29c4
|
|
| BLAKE2b-256 |
47b23f6bacb001ec98cf309fd1bc1a076c7090c865315d6cec1dad3eadc10fce
|
Provenance
The following attestation bundles were made for spork_lang-0.4.3-py3-none-any.whl:
Publisher:
build.yml on spork-it/spork-lang
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spork_lang-0.4.3-py3-none-any.whl -
Subject digest:
1ffe6d0016db5da94f63eb88b578e5428499c6dc08896155bea4a59c726d34ec - Sigstore transparency entry: 2641821669
- Sigstore integration time:
-
Permalink:
spork-it/spork-lang@7dd047bd370d2f84311719302925673ee288cdfe -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/spork-it
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@7dd047bd370d2f84311719302925673ee288cdfe -
Trigger Event:
push
-
Statement type: