Metadata-Version: 2.4
Name: spork-runtime
Version: 0.1.1
Summary: Compiler-free runtime and Python standard library for Spork
Author-email: Grant Wade <grant@spork.sh>
License-Expression: MIT
Project-URL: Homepage, https://github.com/spork-it/spork-runtime
Project-URL: Documentation, https://github.com/spork-it/spork-runtime#readme
Project-URL: Repository, https://github.com/spork-it/spork-runtime
Project-URL: Issues, https://github.com/spork-it/spork-runtime/issues
Project-URL: Changelog, https://github.com/spork-it/spork-runtime/blob/main/CHANGELOG.md
Keywords: lisp,clojure,runtime,standard-library,persistent-data-structures
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: spork-pds<0.2.0,>=0.1.3
Provides-Extra: dev
Requires-Dist: build>=1; extra == "dev"
Requires-Dist: mypy>=1.11; extra == "dev"
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# spork-runtime

`spork-runtime` is the runtime distribution for Spork programs. It contains:

- the runtime types and helpers emitted Python code depends on;
- persistent collection integration backed by [`spork-pds`](https://github.com/spork-it/spork-pds);
- namespace and protocol support;
- JSON support and declared-test descriptors; and
- the Spork standard library implemented as ordinary Python modules.

It intentionally contains no reader, compiler, import hook, or `.spork` source files. A compiled Spork application can therefore depend on `spork-runtime` without installing `spork-lang` or compiling the standard library during installation.

## Install

```bash
pip install spork-runtime
```

## Python API

```python
from spork.runtime import Keyword, assoc, get, hash_map, vec
from spork.std import map as maps
from spork.std import string

users = hash_map(Keyword("count"), 1)
users = maps.update(users, Keyword("count"), lambda value: value + 1)
assert get(users, Keyword("count")) == 2
assert string.join(", ", vec("Spork", "Python")) == "Spork, Python"
```

Python standard-library modules mirror the Spork namespaces:

| Spork namespace | Python module |
| --- | --- |
| `std.string` | `spork.std.string` |
| `std.map` | `spork.std.map` |
| `std.json` | `spork.std.json` |

`spork.std.prelude.MACROS` exposes the built-in macro implementations as Python callables for the compiler to install into its macro environment.

## Development

```bash
python -m venv .venv
.venv/bin/python -m pip install -e '.[dev]'
.venv/bin/python -m pytest
.venv/bin/python -m build
```

The `spork` directory is an implicit namespace package. This allows `spork-runtime`, `spork-pds`, and `spork-lang` to provide separate portions of the same Python namespace.
