Sheaf is a functional language for differentiable computation. It is inspired by Clojure and is designed to operate within the Python/JAX machine learning ecosystem.
Sheaf has three main goals:
- Clojure Paradigm: Homoiconicity (code is data), immutability and minimalist syntax.
- Native XLA Performance: Sheaf code runs on GPUs/TPUs through JAX.
- Seamless Interop with Python: Compiled to pure JAX functions natively callable from Python.
Sample code:
(defn transformer-block [x layer-p config]
(as-> x h
(-> h ;; 1. Self-Attention
(layer-norm (get layer-p :ln1) 2)
(multi-head-attention layer-p config)
(first) ;; Attention output
(+ h)) ;; Residual 1
(-> h ;; 2. MLP
(layer-norm (get layer-p :ln2) 2)
(mlp (get layer-p :mlp))
(+ h)))) ;; Residual 2
Python interoperability
from sheaf import Sheaf
shf = Sheaf("mlp.shf")
for x, y in zip(X, shf.forward(X, params)):
print(f" {x} -> {y[0]:.3f}")
Metadata
Release files for sheaf-lang 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sheaf_lang-1.2.0.tar.gz | 79.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sheaf_lang-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 161.3 kB
Release files / sheaf_lang-1.2.0.tar.gz
| Download URL | sheaf_lang-1.2.0.tar.gz |
|---|---|
| Size | 79.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54bfd3b38314f874a5958d909d34e0c068e4bc04808b2cb2a3a6f5815b96ae29
|
|
BLAKE2b-256 checksum How to use checksums |
ff08d73cb62bc2e9156e8d906bb1d9596d81952b4733c8d5b3535ca66647b44b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / sheaf_lang-1.2.0-py3-none-any.whl
| Download URL | sheaf_lang-1.2.0-py3-none-any.whl |
|---|---|
| Size | 82.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e7fbab6f2251bf420daff31882c94740efd63c7bbadfdf659afb2dfde537986
|
|
BLAKE2b-256 checksum How to use checksums |
e47d87719dc20b610c8708749c6c9708489553d1f989cfd3bb7449801aa35543
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|