install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/srfi" ~/.claude/skills/plurigrid-asi-srfi-f110bf && rm -rf "$T"
manifest:
skills/srfi/SKILL.mdsource content
SRFI Skill
"SRFIs extend the Scheme programming language. You can help." — srfi.schemers.org
Scheme Requests for Implementation: portable library specifications with GF(3) categorization.
Overview
SRFIs are community-driven specifications that extend Scheme beyond R5RS/R6RS/R7RS. Each SRFI has a unique number, status (draft/final/withdrawn), and reference implementation.
Core SRFIs by Category
Data Structures [MINUS: -1]
| SRFI | Name | Status | Key Exports |
|---|---|---|---|
| 1 | List Library | Final | , , , |
| 4 | Homogeneous Vectors | Final | , , typed arrays |
| 9 | Defining Record Types | Final | |
| 14 | Character Sets | Final | , |
| 69 | Basic Hash Tables | Final | , |
| 113 | Sets and Bags | Final | , , |
| 125 | Intermediate Hash Tables | Final | , comparators |
| 128 | Comparators (Reduced) | Final | , |
| 133 | Vector Library | Final | , |
| 146 | Mappings | Final | , functional maps |
| 158 | Generators and Accumulators | Final | |
Control Flow [ERGODIC: 0]
| SRFI | Name | Status | Key Exports |
|---|---|---|---|
| 2 | AND-LET* | Final | short-circuit binding |
| 8 | receive | Final | for multiple values |
| 11 | let-values | Final | , |
| 18 | Multithreading | Final | , , |
| 34 | Exception Handling | Final | , |
| 39 | Parameter Objects | Final | , |
| 45 | Primitives for Lazy Eval | Final | , , |
| 124 | Ephemerons | Final | , weak references |
| 154 | First-Class Dynamic Extents | Final | , delimited continuations |
| 155 | Promises | Final | , iterative lazy |
| 226 | Control Features | Final | , , |
Syntax & Macros [PLUS: +1]
| SRFI | Name | Status | Key Exports |
|---|---|---|---|
| 0 | Feature-Based Conditionals | Final | |
| 6 | Basic String Ports | Final | , |
| 26 | Cut/Cute | Final | , partial application |
| 42 | Eager Comprehensions | Final | , , |
| 46 | Syntax for Multiple Values | Final | , |
| 57 | Records | Withdrawn | (superseded by 99, 136) |
| 72 | Hygienic Macros | Final | compatible |
| 139 | Syntax Parameters | Final | |
| 147 | Custom Macro Transformers | Final | |
| 149 | Basic Syntax-Rules Extensions | Final | , patterns |
| 211 | Scheme Macros for Definitions | Final | |
I/O & System [MINUS: -1]
| SRFI | Name | Status | Key Exports |
|---|---|---|---|
| 6 | Basic String Ports | Final | in-memory I/O |
| 28 | Basic Format Strings | Final | |
| 38 | External Representation with Cycles | Final | , |
| 48 | Intermediate Format Strings | Final | with more directives |
| 106 | Basic Socket Interface | Final | , |
| 170 | POSIX API | Final | , |
| 180 | JSON | Final | , |
| 192 | Port Positioning | Final | , |
| 193 | Command Line | Final | , |
Numeric [ERGODIC: 0]
| SRFI | Name | Status | Key Exports |
|---|---|---|---|
| 27 | Sources of Random Bits | Final | , |
| 60 | Integers as Bits | Final | , |
| 94 | Type-Restricted Numerics | Final | , |
| 141 | Integer Division | Final | , , |
| 143 | Fixnums | Final | , |
| 144 | Flonums | Final | , , |
| 151 | Bitwise Ops on Arbitrary Integers | Final | , |
| 166 | Monadic Formatting | Final | with monadic composition |
Testing & Debugging [PLUS: +1]
| SRFI | Name | Status | Key Exports |
|---|---|---|---|
| 64 | A Scheme API for Test Suites | Final | , , |
| 78 | Lightweight Testing | Final | , |
| 219 | Define Higher-Order Lambda | Final | with curry |
Pattern Matching [PLUS: +1]
| SRFI | Name | Status | Key Exports |
|---|---|---|---|
| 204 | Wright-Cartwright-Shinn Pattern Matcher | Final | , |
GF(3) Distribution
MINUS (-1): Data Structures, I/O & System ERGODIC (0): Control Flow, Numeric PLUS (+1): Syntax & Macros, Testing, Pattern Matching Conservation: Σ(categories) ≡ 0 (mod 3) when balanced usage
R7RS-Large Libraries (Red/Tangerine Editions)
R7RS-Large incorporates SRFIs as standard libraries:
Red Edition (2019)
← SRFI 1(scheme list)
← SRFI 133(scheme vector)
← SRFI 132(scheme sort)
← SRFI 113(scheme set)
← SRFI 14(scheme charset)
← SRFI 125(scheme hash-table)
← SRFI 116(scheme ilist)
← SRFI 101(scheme rlist)
← SRFI 134(scheme ideque)
← SRFI 135(scheme text)
← SRFI 158(scheme generator)
← SRFI 127(scheme lseq)
← SRFI 41(scheme stream)
← SRFI 111(scheme box)
← SRFI 117(scheme list-queue)
← SRFI 128(scheme comparator)
Tangerine Edition (2021)
← SRFI 151(scheme bitwise)
← SRFI 143(scheme fixnum)
← SRFI 144(scheme flonum)
← SRFI 141(scheme division)
← R6RS(scheme bytevector)
← SRFI 146(scheme mapping)
← SRFI 115(scheme regex)
Implementation Support Matrix
| SRFI | Chez | Chicken | Gauche | Guile | Racket |
|---|---|---|---|---|---|
| 1 | ✓ | ✓ | ✓ | ✓ | ✓ |
| 9 | ✓ | ✓ | ✓ | ✓ | ✓ |
| 18 | ✓ | ✓ | ✓ | ✓ | ✓ |
| 27 | ✓ | ✓ | ✓ | ✓ | ✓ |
| 64 | ✓ | ✓ | ✓ | ✓ | ✓ |
| 125 | ✓ | ✓ | ✓ | ✓ | ✓ |
| 158 | ✓ | ✓ | ✓ | ✓ | ✓ |
| 180 | ✓ | ✓ | ✓ | ✓ | ✓ |
SRFI-27: Random Sources (Key for Gay.jl Bridge)
;; SRFI-27 provides the abstraction layer for splittable RNG (import (srfi 27)) ;; Create a random source with specific seed (define my-source (make-random-source)) (random-source-pseudo-randomize! my-source 1069 42) ;; Get integers and reals (define rand-int (random-source-make-integers my-source)) (define rand-real (random-source-make-reals my-source)) ;; GF(3) trit from random source (define (random-trit source) (- ((random-source-make-integers source) 3) 1))
SRFI-171: Transducers
;; Composable sequence transformations (import (srfi 171)) ;; Filter, map, take composed (define xform (compose (tfilter even?) (tmap (lambda (x) (* x x))) (ttake 5))) ;; Apply to list (list-transduce xform rcons '(1 2 3 4 5 6 7 8 9 10)) ;; => (4 16 36 64 100)
SRFI-204: Pattern Matching
(import (srfi 204)) ;; Destructuring with guards (match '(1 2 3) ((x y z) (guard (< x y z)) (list z y x)) (_ 'no-match)) ;; => (3 2 1) ;; Quasiquote patterns (match '(lambda (x) (+ x 1)) (`(lambda (,var) (+ ,var 1)) var) (_ #f)) ;; => x
Integration with Little Schemer
| SRFI | Little Schemer Concept |
|---|---|
| 1 | , , |
| 9 | Atoms as records |
| 27 | Y combinator with random exploration |
| 45 | Lazy evaluation (Seasoned Ch. 16) |
| 154 | Continuations (Seasoned Ch. 13) |
| 171 | Collectors as transducers |
| 204 | Pattern matching vs cond |
Commands
# Search SRFIs by keyword srfi search "hash table" # Show SRFI abstract srfi show 125 # Clone SRFI implementation srfi clone 171 # Open in browser srfi open 204 # List all final SRFIs srfi list --status final
References
- srfi.schemers.org - Official SRFI home
- docs.scheme.org/srfi/support - Implementation matrix
- R7RS-Large - Standard incorporation
- Practical Scheme SRFI Cross-Reference