mame/quine-relay
An uroboros program with 100+ programming languages
Slowing — last commit 7mo ago
worst of 4 axesno license — legally unclear
no license — can't legally use code
Documented and popular — useful reference codebase to read through.
no license — can't legally use code; last commit was 7mo ago
- ✓Last commit 7mo ago
- ✓10 active contributors
- ✓CI configured
Show 4 more →Show less
- ✓Tests present
- ⚠Slowing — last commit 7mo ago
- ⚠Single-maintainer risk — top contributor 84% of recent commits
- ⚠No license — legally unclear to depend on
What would change the summary?
- →Use as dependency Concerns → Mixed if: publish a permissive license (MIT, Apache-2.0, etc.)
- →Fork & modify Concerns → Mixed if: add a LICENSE file
- →Deploy as-is Concerns → Mixed if: add a LICENSE file
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Great to learn from" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/mame/quine-relay)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/mame/quine-relay on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: mame/quine-relay
Generated by RepoPilot · 2026-05-10 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/mame/quine-relay shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
WAIT — Slowing — last commit 7mo ago
- Last commit 7mo ago
- 10 active contributors
- CI configured
- Tests present
- ⚠ Slowing — last commit 7mo ago
- ⚠ Single-maintainer risk — top contributor 84% of recent commits
- ⚠ No license — legally unclear to depend on
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live mame/quine-relay
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/mame/quine-relay.
What it runs against: a local clone of mame/quine-relay — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in mame/quine-relay | Confirms the artifact applies here, not a fork |
| 2 | Default branch master exists | Catches branch renames |
| 3 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 4 | Last commit ≤ 227 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of mame/quine-relay. If you don't
# have one yet, run these first:
#
# git clone https://github.com/mame/quine-relay.git
# cd quine-relay
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of mame/quine-relay and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "mame/quine-relay(\\.git)?\\b" \\
&& ok "origin remote is mame/quine-relay" \\
|| miss "origin remote is not mame/quine-relay (artifact may be from a fork)"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 4. Critical files exist
test -f "QR.rb" \\
&& ok "QR.rb" \\
|| miss "missing critical file: QR.rb"
test -f "src/code-gen.rb" \\
&& ok "src/code-gen.rb" \\
|| miss "missing critical file: src/code-gen.rb"
test -f "src/Rakefile" \\
&& ok "src/Rakefile" \\
|| miss "missing critical file: src/Rakefile"
test -f "Makefile" \\
&& ok "Makefile" \\
|| miss "missing critical file: Makefile"
test -f "src/code-gen-pool.rb" \\
&& ok "src/code-gen-pool.rb" \\
|| miss "missing critical file: src/code-gen-pool.rb"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 227 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~197d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/mame/quine-relay"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
QR.rb is a 128-language quine relay that produces an executable chain: a Ruby program that outputs Rust code, which outputs Scala code, which outputs... (through 128 languages) until the original Ruby source regenerates. It's a self-referential program demonstrating extreme polyglot programming where each language's output is valid code in the next language in the chain. Monolithic structure: QR.rb is the entry point, with src/ containing generator scripts (*gen.rb files) that produce intermediate forms (QR.rs.gen.rb→QR.rs, etc.). vendor/ houses precompiled interpreters and language implementations (blc.rb, golfscript.rb, etc.). CI runs the full chain via Makefile orchestration; test.rb validates each stage. The architecture is a linear pipeline where output of stage N feeds input to stage N+1.
👥Who it's for
Programming language enthusiasts, competitive code golfers, and language design researchers who want to understand code generation patterns and test interpreter/compiler compatibility across esoteric and mainstream languages simultaneously.
🌱Maturity & risk
Actively maintained with CI/CD via GitHub Actions (.github/workflows/main.yml), extensive vendor/ directory with bundled interpreters, and a comprehensive Makefile for orchestration. The project has evolved from a 50-language version to 128 languages, indicating sustained effort. This is a mature, production-ready showcase project with robust testing infrastructure.
Standard open source risks apply.
Active areas of work
The repository maintains the 128-language chain with CI verification. The Dockerfile and vendor/ builds are kept current to support modern interpreter versions. GitHub Actions workflow (main.yml) is the active testing mechanism. No breaking changes visible—focus is on maintaining compatibility as interpreters evolve.
🚀Get running
On Ubuntu 25.10: (1) sudo apt-get install <100+ interpreters> (listed in README), (2) sudo apt-get install cmake libpng-dev libgd-dev groff bison curl && make -C vendor to compile bundled interpreters, (3) ulimit -s unlimited && ruby QR.rb > QR.rs && rustc QR.rs && ./QR > QR.scala ... (continue chain as shown in README). Full chain takes hours; see Makefile for the complete sequence.
Daily commands:
Full execution: ulimit -s unlimited && ruby QR.rb > QR.rs && rustc QR.rs && ./QR > QR.scala && scalac QR.scala && scala QR > QR.scm ... (continues for 128 stages). For testing without full chain: ruby src/test.rb. Individual stage validation visible in Makefile targets.
🗺️Map of the codebase
QR.rb— The entry point and root quine that generates Rust code; every contributor must understand this is the self-referential heart of the entire relay chain.src/code-gen.rb— Core code generation engine that produces the next language in the chain; understanding this is essential for adding new languages or modifying the relay logic.src/Rakefile— Build orchestration and test harness; contributors need this to verify the relay generates correctly across all 128 languages.Makefile— Top-level build entry point and CI integration; required for understanding the development workflow and how the quine is validated.src/code-gen-pool.rb— Language interpreter/compiler pool management; critical for understanding how each language in the chain is executed and chained together.README.md— Project overview and setup instructions; every contributor should start here to understand the quine relay concept and architecture..github/workflows/main.yml— CI/CD pipeline that validates the entire 128-language relay on each commit; essential for understanding test expectations.
🛠️How to make changes
Add a new programming language to the relay chain
- Define the language's code generation logic in
src/code-gen.rbby adding a new case for your language in the output formatter (maps language to its quoting/output syntax) (src/code-gen.rb) - Add an interpreter/compiler entry to
src/code-gen-pool.rbso the code generation pool knows how to execute your language and capture its output (src/code-gen-pool.rb) - If using an esoteric or uncommon language, add a vendor interpreter or compiler stub to
vendor/directory with proper Makefile integration (vendor/Makefile) - Update the Rakefile build tasks to include your language in the chain verification sequence (
src/Rakefile) - Run
maketo regenerate all artifacts and verify the relay chain still produces valid output (Makefile)
Add support for a new esoteric language with boot data
- Create a new generator file following the pattern
src/<language>-boot.dat.gen.rbthat produces minimal boot loader bytecode (src/blc-boot.dat.gen.rb) - Implement the minimal interpreter for your language in
vendor/<language>.rbto execute and test the boot data (vendor/bf.rb) - Update
src/code-gen-pool.rbto handle the binary boot data and chain it properly with the next language stage (src/code-gen-pool.rb) - Add Dockerfile RUN commands in
src/Dockerfile.gen.rbto install any native dependencies your language needs (src/Dockerfile.gen.rb)
Modify the relay chain order or swap languages
- Update the language sequence list in
src/code-gen.rbto reorder or replace languages in the relay (src/code-gen.rb) - Verify the new language has proper interpreter/compiler support registered in
src/code-gen-pool.rb(src/code-gen-pool.rb) - Regenerate all build artifacts and update documentation by running the generators listed in
src/Rakefile(src/Rakefile) - Validate the entire relay executes correctly with
make testto ensure the chain produces valid quine output (Makefile)
🔧Why these technologies
- Ruby — Chosen as the root quine language for its metaprogramming capabilities and string interpolation features that make self-referential code tractable
- 128+ Programming Languages — The core concept: each language generates the next, creating a circular dependency chain that closes when REXX outputs the original Ruby
- Docker & CI/CD — Necessary to ensure all 100+ language interpreters/compilers are available reproducibly; validates the relay chain works across environments
- Esoteric Languages (BLC, Grass, Lazy K, etc.) — Increases complexity and demonstrates the relay can handle even minimal, exotic language specifications with custom boot loaders
⚖️Trade-offs already made
-
Include esoteric and compiled languages alongside mainstream ones
- Why: Maximizes the intellectual challenge and novelty of the project; demonstrates universal Turing completeness
- Consequence: Build time is extremely long (~hours); requires substantial compute resources and extensive dependency installation
-
Strict quine property: output must byte-for-byte match input
- Why: Ensures logical closure of the relay; proves the entire chain is self-consistent
- Consequence: Any whitespace or encoding change breaks the quine; requires precise control over code generation and string escaping
-
Generate intermediate build artifacts (Dockerfile, Makefile, README) from code generators
- Why: Keeps the source of truth in
src/code-gen*.rband ensures consistency across build configurations - Consequence: Manual editing of generated files is error-prone; all changes must flow through the generators
- Why: Keeps the source of truth in
-
Use custom boot loaders and minimal interpreters for exotic languages
- Why: Allows inclusion of languages with no standard interpreter; reduces external dependencies
- Consequence: Significant engineering effort to implement parsers/evaluators; risk of subtle correctness bugs in uncommon language implementations
🚫Non-goals (don't propose these)
- Does not provide a general-purpose code transformation or transpilation tool
- Not designed for practical language interoperability or integration
- Does not optimize for runtime performance; execution is inherently slow due to chain length
- Not a showcase of idiomatic code in any single language; heavily uses tricks and obfuscation to maintain quine property
- Does not handle real-time or streaming code generation; entire relay must complete in a single process
- Not compatible with language versions beyond those tested in CI; requires exact versions of compilers/interpreters
🪤Traps & gotchas
Stack size limit required: ulimit -s unlimited must be set before execution or the relay fails at deep recursion stages. Language ordering is brittle—swapping stages breaks the chain unless intermediate code is retemplated. Interpreter versions matter: minor version upgrades can introduce syntax changes that break code generation (e.g., Ruby 3.0+ removed certain Kernel methods). Building vendor/ requires cmake, libpng-dev, libgd-dev, groff, bison, curl—missing one silently breaks downstream languages. The full chain execution takes hours; partial failures mid-chain are hard to diagnose without running each stage in isolation. Environment-dependent: Docker (Dockerfile provided) ensures reproducibility, but running on bare metal risks missing esoteric interpreter quirks.
🏗️Architecture
💡Concepts to learn
- Quine — The entire relay is built on quine mechanics—each language stage outputs valid code in the next language; understanding self-replicating programs is foundational
- Polyglot programming — The relay demonstrates extreme polyglot design by generating syntactically valid code across 128 distinct language families with different token rules, escaping, and string representations
- Code generation templating — QR.rb uses template-based code generation (visible in src/code-gen.rb) to inject data into target language syntax; understanding how to safely interpolate code is critical
- Interpreter/compiler bootstrapping — The relay bootstraps itself through compiled outputs (rustc, scalac, etc.) and interpreted outputs (ruby, python); understanding build chains and cross-compilation is essential
- Stack exhaustion / tail call optimization — The relay requires
ulimit -s unlimitedbecause deep language chains risk stack overflow; understanding recursion depth and stack management across languages matters - String escaping and character encoding — The relay must safely escape output from one language for consumption by the next; handling quotes, backslashes, Unicode across 128 languages is non-trivial
- Deterministic output validation — SHA256SUMS file validates that the final Ruby output matches the original; understanding checksums and reproducible builds ensures the relay closes correctly
🔗Related repos
mame/quine-relay-50— Previous 50-language version of the same project; useful for understanding incremental language additions and backward compatibilitymame/streem— Mame's streaming language implementation; demonstrates similar polyglot interpreter design principlesnorvig/pytudes— Norvig's Python programming exercises including quine and metaprogramming examples; educational predecessor to full-chain quinesavik-das/quine— Simpler single-language quine implementations; stepping stone to understanding the relay's complexityshinh/3proxy— Another extreme polyglot project (code that is valid in 20+ languages simultaneously); different approach to multi-language execution
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add language coverage matrix to CI workflow (main.yml)
The .github/workflows/main.yml exists but likely doesn't validate that all 128+ languages in the chain execute correctly. Add a structured CI job that tests each language stage of the quine relay and reports which languages fail, making it easier to catch regressions when updating vendor/ dependencies.
- [ ] Examine current .github/workflows/main.yml to see what's tested
- [ ] Create a new job in main.yml that runs src/test.rb with verbose output per language stage
- [ ] Add a summary step that generates a language support matrix (pass/fail for each of the 128 languages)
- [ ] Document the matrix output format in README.md under a 'CI Status' section
Refactor code generators into a shared framework in src/
The src/ directory has multiple .gen.rb files (QR.rb.gen.rb, Dockerfile.gen.rb, Makefile.gen.rb, etc.) that likely share common patterns for code generation. Extracting shared logic into src/code-gen.rb (which exists but may be underutilized) reduces duplication and makes adding new generated files easier.
- [ ] Analyze the structure of existing .gen.rb files to identify common patterns
- [ ] Refactor shared template logic, variable substitution, and output formatting into utility methods in src/code-gen.rb
- [ ] Update src/Rakefile to use the shared framework for all .gen.rb tasks
- [ ] Add unit tests in src/test.rb that validate the code-gen.rb framework produces consistent output
Create a vendor/ dependency audit and update guide in docs/
The vendor/ directory contains tarballs, zips, and custom interpreters (.rb files) for esoteric languages (Acme::Chef, Velato, BrainFuck, etc.). There's no documented way to audit or update these dependencies, making it hard for new contributors to safely update language implementations or add new ones.
- [ ] Create docs/VENDOR_MAINTENANCE.md documenting each vendor/ file (source, version, why it's needed)
- [ ] Add a vendor audit script (e.g., src/vendor-audit.rb) that checksums vendors/ against documented versions and flags outdated files
- [ ] Document in README.md how to add a new language to the relay (vendor setup, generator script, integration steps)
- [ ] Update SHA256SUMS.gen.rb to include vendor/ files, enabling automated integrity checks during build
🌿Good first issues
- Add language coverage badges: Create a script that validates each of the 128 languages compiles/interprets successfully and outputs a coverage report in CI; currently only the final Ruby output is visibly validated
- Document stage-by-stage output sizes: Add a Makefile target that logs the file size of each intermediate (.rs, .scala, .scm, etc.) to track code bloat across the chain—useful for optimizing code generation
- Create a minimal 10-language test relay: Build a QR-mini.rb that chains only 10 core languages (Ruby→Rust→Scala→Python→Bash→C→JavaScript→Java→Perl→Ruby) for rapid local testing without 100+ interpreter installation
⭐Top contributors
Click to expand
Top contributors
- @mame — 84 commits
- @thaliaarchi — 3 commits
- @japonophile — 3 commits
- @gzz2000 — 2 commits
- @Charlie-Sumorok — 2 commits
📝Recent commits
Click to expand
Recent commits
c2aa509— Update README.md (mame)5298413— make npiet compile (mame)3ab9fb9— Update SHA256SUMS (mame)1dad88c— Move to Ubuntu 25.10 (Questing Quokka) (mame)b9c8056— Move to Ubuntu 25.04 (Plucky Puffin) (mame)5942c25— SHA1SUMS -> SHA256SUMS (mame)d8f37b0— Add .gitattributes (mame)e8c003a— Fix backslash escaping in heredoc (thaliaarchi)2ed61a6— Update SHA256SUMS (mame)888934b— Move to Ubuntu 24.10 (Oracular Oriole) (mame)
🔒Security observations
This polyglot quine-relay project has moderate security concerns. The primary risks are: (1) unvetted vendor dependencies without integrity verification, (2) overly permissive Docker configuration running as root with unpinned packages, (3) dynamic code generation with unknown injection risk, and (4) installation of 100+ interpreters expanding attack surface. The project lacks standard security practices like SBOM, image signing, and explicit user isolation. Immediate focus should be on verifying vendor archives, hardening the Dockerfile, and documenting code generation security measures.
- High · Overly Permissive Base Image —
Dockerfile (line 1-2). The Dockerfile uses 'ubuntu:25.10' without specifying a digest. This allows for supply chain attacks if the image tag is mutated. Additionally, running 'apt-get upgrade -y' installs all available updates without pinning versions, which can introduce breaking changes or unexpected behavior. Fix: Use a specific digest: 'ubuntu:25.10@sha256:...' and remove or carefully manage 'apt-get upgrade'. Pin specific package versions instead of using 'install -y' without version constraints. - High · Unvetted Third-Party Archives in Vendor Directory —
vendor/ directory contents. The vendor/ directory contains multiple pre-compiled/archived dependencies (.tar.gz, .zip, .tar.bz2) with no integrity verification visible in the codebase. Files like 'Acme-Chef-1.03.tar.gz', 'npiet-1.3e.tar.bz2', etc. are directly extracted/used without checksum validation shown in build process. Fix: Add SHA256 checksums for all vendor archives in a signed manifest. Verify checksums before extraction. Consider using a package manager or lockfile format with cryptographic verification. - Medium · Incomplete Dockerfile Instruction —
Dockerfile (last visible RUN instruction). The final RUN instruction in the Dockerfile is truncated (ends with '&&'), indicating incomplete or malformed Docker configuration. This could lead to build failures or unexpected behavior. Fix: Complete the truncated RUN instruction. Ensure all Dockerfile instructions are syntactically valid and properly terminated. - Medium · No Explicit HEALTHCHECK or Security Scanning —
Dockerfile. The Dockerfile installs 100+ language interpreters/compilers but provides no healthcheck, security scanning directives, or image signing. This increases the attack surface significantly. Fix: Add HEALTHCHECK instructions, use multi-stage builds to minimize final image size, implement container image scanning (e.g., Trivy), and consider signing images with Cosign. - Medium · No Explicit Non-Root User —
Dockerfile. The Dockerfile does not create or specify a non-root user. Containers will run as root by default, violating the principle of least privilege. Fix: Create a dedicated non-root user and use 'USER' directive: 'RUN useradd -m -s /bin/bash appuser && USER appuser' - Medium · Generated Code Security Unknown —
src/code-gen.rb, src/*.gen.rb files. Multiple '.gen.rb' files generate executable code dynamically (QR.rb.gen.rb, code-gen.rb, etc.). Without understanding the generation logic, there's risk of code injection or unintended script execution. Fix: Audit code generation scripts for injection vulnerabilities. Implement input validation and output sanitization. Use sandboxed environments for code generation. - Low · Missing SBOM and Dependency Tracking —
Project root. No explicit Software Bill of Materials (SBOM) or dependency lock file is visible. The project installs numerous language runtimes without documented version constraints. Fix: Generate and maintain an SBOM using tools like syft or cyclonedx. Document all dependencies with pinned versions. - Low · Vendor Directory Not Gitignored —
vendor/ directory. Vendor binaries and archives are committed to git, increasing repository size and potential for stale/vulnerable versions. Fix: Add vendor/ to .gitignore and use package managers or a build-time download mechanism with integrity checks instead.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.