spork
a Lisp hosted on CPython
Spork compiles Lisp forms to Python's AST. Python remains the runtime, import system, and package ecosystem. Spork adds expression-oriented forms, macros, persistent collections, and project tooling.
Run a source file.
A .spork file can run directly. No manifest, scaffold, or separate build step is required; project configuration becomes useful when you need dependencies, tests, and packaging.
(defn greet [name]
(fmt "Hello, {}!" name))
(print (greet "Spork"))
$ spork hello.sporkHello, Spork!Import Python directly.
Imports go through Python's loader, and imported classes, exceptions, iterators, async values, and extension modules remain ordinary Python objects. There is no FFI layer or parallel package ecosystem.
(ns python-demo
(:import [math :refer [sqrt]]
[pathlib :refer [Path]]))
(def report (Path "build/report.txt"))
(print report.suffix)
(print (sqrt 81))
$ spork python.spork.txt
9.0Use expressions, macros, and persistent data.
Forms are expressions, application code can define macros, and collection updates return new persistent values instead of changing the original. These are language features rather than wrapper APIs.
(def original
{:language "Spork" :version 1})
(def current
(-> original
(assoc :version 2)
(assoc :status :pre-1.0)))
(print [(:version original)
(:version current)])
$ spork persistent.spork[1 2]Add a manifest for a project.
A spork.it file declares the toolchain, source paths, tests, and ordinary Python dependencies. Spork keeps the project environment isolated and uses it for checks, tests, runs, and distribution builds.
{:name "hello"
:version "0.1.0"
:requires-python ">=3.10"
:spork-version ">=0.6,<0.7"
:source-paths ["src"]
:test-paths ["tests"]}
$ spork sync && spork test