Skip to main content

PatrickScript

A programming language with exactly two lexical tokens: the literal word patrick and a single space ( ).

PatrickScript's entire specification — computational model, grammar, semantics, tooling — is designed and authored by an LLM. The only human-fixed inputs are the name and the two tokens. Everything else is the agent's to decide.

The language is owned by the patrick-script-worker track in the reflection substrate. The specification, reference implementation, and conformance corpus live in this repository.

Status: v1.3.0 — spec, reference interpreter, assembler, and 50-test conformance corpus (+ 12 disassembler round-trip tests) complete. Turing complete via JUMP/JUMPZ/JUMPNZ + unbounded memory. v1.1.0 adds CALL/RET subroutines (arities 11–12). v1.2.0 adds PUSHN single-instruction negative literal (arity 13). v1.3.0 adds PICK stack-copy instruction (arity 14).

Install (once published to PyPI)

pip install patrickscript
# or
uv add patrickscript

After install, patrickscript and patrickscript-asm are on PATH.

Running programs

./patrickscript <program.ps>
./patrickscript --disassemble <program.ps>

Or directly:

python3 src/patrickscript/ps.py <program.ps>

Running the conformance corpus

bash corpus/run-tests.sh

All 49 corpus tests and 12 disassembler round-trip tests should pass.

Writing programs with the assembler

Writing raw PatrickScript is impractical (PUSH 42 requires one patrick token and 43 spaces). Use the assembler for human-readable input:

./psa program.psa > program.ps
./patrickscript program.ps

Or directly:

python3 src/patrickscript/psa.py program.psa > program.ps
./patrickscript program.ps

Assembly format: one mnemonic per line, labels end with :, comments start with ;. String literals via .string "text" directive (emits PUSH+OUTCHAR per character, supports \n \t \\ \"). See examples/ for complete programs.

Examples

examples/ contains:

  • hello-world.psa — "Hello, World!" via .string directive (v1.1.0)
  • counter.psa — infinite counter (0, 1, 2, ...)
  • echo.psa — copy stdin to stdout byte by byte
  • fibonacci.psa — first 10 Fibonacci numbers
  • factorial-recursive.psa — recursive 5! using CALL/RET; shows nested recursion (v1.1.0)
  • fizzbuzz.psa — FizzBuzz 1..15 using CALL/RET subroutines + .string (v1.1.0)
  • call-string.psa — CALL/RET subroutine called twice; .string inside subroutine (v1.1.0)
  • square.psa — compute n² using PICK 0 for non-destructive stack copy (v1.3.0)
  • pick-demo.psa — PICK 2 copies a deep stack element; prints four characters (v1.3.0)
  • rot13.psa — ROT13 cipher: rotate A-Z and a-z by 13, pass others through; its own inverse (v1.3.0)

To run an example:

python3 src/patrickscript/psa.py examples/fibonacci.psa > /tmp/fib.ps
./patrickscript /tmp/fib.ps

Documentation conventions

Raw-legible tables: every markdown table in every *.md documentation file in this repo is formatted so the raw source is legible — column pipes aligned vertically, separator rows padded to match. Pure presentation; content is never changed to satisfy alignment. Apply this to any table you add or edit.

Metadata

Release files for patrickscript 1.3.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 patrickscript 1.3.0
File Size Uploaded Provenance
patrickscript-1.3.0.tar.gz 18.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for patrickscript 1.3.0
File Interpreter ABI Platform
patrickscript-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.6 kB

Release files / patrickscript-1.3.0.tar.gz

Download URL patrickscript-1.3.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8ba7413da759f2d7fa0fbd68b63d5821ba6d2605c2e1a0263422ea021c07831d
BLAKE2b-256 checksum
How to use checksums
8a7219acea42aee38f7e6d260f59fa77a997acaf55934b6ccf4f0c341e4087fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.10","id":"oracular","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / patrickscript-1.3.0-py3-none-any.whl

Download URL patrickscript-1.3.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b107360e734028973fb6028636c96250a9136d7de0a66c1d01fac5134afcb36
BLAKE2b-256 checksum
How to use checksums
ada1defcc58690a346de4db834cff16ab22d54b58d800e01d9bad132226c406d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.10","id":"oracular","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for patrickscript 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files No provenance

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