Shared SNOBOL4 programs, libraries, and benchmarks for the snobol4ever organization.
This corpus follows the conventions established by James F. Gimpel in Algorithms in SNOBOL4 (Wiley, 1976; redistributed by Catspaw, Inc.) — the closest thing the SNOBOL4 community has to a canonical standard:
| Extension | Meaning | Example |
|---|---|---|
.sno |
Complete program — has an END statement, runs standalone |
hello.sno |
.inc |
Include file — DEFINE-only, no END, used via -include |
stack.inc |
Data files accompanying a program use whatever extension fits the content
(.dat, .in, .txt). Gimpel used .IN for data files (POKER.IN, RPOEM.IN).
SPITBOL uses .spt for the same programs — we keep .sno throughout
since our primary oracles are CSNOBOL4 and SPITBOL-x64, and extension
is not semantically meaningful to either.
CSNOBOL4 resolves -include files via (in order):
- The
-I DIRcommand-line flag (repeatable) SNOPATHenvironment variable (colon-separated, Unix)SNOLIBenvironment variable (legacy name, pre-1.5)- Compiled-in default:
/usr/local/lib/snobol4/
To use the lib/ standard library without a path prefix:
export SNOPATH=/path/to/corpus/lib
snobol4 -f myprogram.snoOr invoke directly:
snobol4 -I /path/to/corpus/lib -f myprogram.snocorpus/
│
├── lib/ ← Standard library (.inc files, -include by name)
│ ├── stack.inc ← stack_push/pop/peek/top/depth
│ ├── case.inc ← lwr/upr/cap/icase
│ ├── math.inc ← max/min/abs/sign/gcd/lcm
│ ├── string.inc ← lpad/rpad/ltrim/rtrim/trim/repeat/contains/index
│ └── README.md
│
├── crosscheck/ ← Harness feed — self-contained, deterministic, fast
│ ├── hello/ ← smoke tests
│ ├── arith/ ← arithmetic and numeric ops
│ ├── strings/ ← string operations
│ ├── patterns/ ← pattern primitives
│ ├── capture/ ← . and $ capture
│ ├── control/ ← goto, loops, label resolution
│ ├── functions/ ← DEFINE, CALL, RETURN, FRETURN, recursion
│ ├── arrays/ ← ARRAY, TABLE, DATA
│ ├── code/ ← CODE(), EVAL()
│ └── library/ ← tests for lib/*.inc
│
├── benchmarks/ ← Performance programs (timing comparisons)
│
├── programs/ ← Real-world programs (may need I/O, -include, env)
│ ├── beauty/ ← beauty.sno beautifier + driver
│ ├── lon/ ← Lon's collection
│ │ ├── sno/ ← general programs
│ │ ├── eng685/ ← ENG 685 NLP coursework + data files
│ │ └── rinky/ ← rinky/social media programs
│ ├── gimpel/ ← Gimpel book programs (.SNO) and functions (.INC)
│ ├── aisnobol/ ← AI in SNOBOL4 (Shafto)
│ ├── dotnet/ ← programs from snobol4dotnet tests
│ └── icon/ ← Icon language translation demos
│
├── generated/ ← Pinned worm outputs that passed crosscheck
│
├── inc/ ← Lon's working include files (production, not stdlib)
│
└── run/ ← Oracle runner scripts
├── run-csnobol4.sh
├── run-spitbol.sh
└── sno.mk
Programs in crosscheck/ must be:
- Self-contained — no
-include, no external file I/O - Deterministic — no
DATE(),TIME(), random numbers - Fast — complete in < 1 second on any engine
- Named for what they test
Files in lib/ must be:
.incextension — signals include-only, noENDDEFINE-only — no executable top-level statements- Self-contained — no
-includedependencies on otherlib/files - Documented — header comment listing every export with signature
- Tested — corresponding
crosscheck/library/test_*.sno
Programs land here via run-worm-batch when they pass crosscheck.
They are regression guards — do not edit by hand.
# In snobol4jvm (path: corpus/lon)
# In snobol4dotnet (path: corpus)
git submodule update --init --recursiveSee benchmarks/README.md for the full catalog and instructions for adding new benchmarks.