Skip to main content
Screenshot 2026-01-27 at 22 55 15

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)

Source distribution for sheaf-lang 1.2.0
File Size Uploaded
sheaf_lang-1.2.0.tar.gz 79.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sheaf-lang 1.2.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page