Add live self-hosting bootstrapper page to bootstrappers section
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m15s

- Update plan page with completion status and results
- Add ~bootstrapper-self-hosting-content component with live G0/G1 verification
- Add _self_hosting_data() helper: loads py.sx, runs it, diffs against G0
- Add "Self-Hosting (py.sx)" to bootstrappers nav and index table
- Wire /bootstrappers/self-hosting route

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 01:18:20 +00:00
parent b4944aa2b6
commit e5acfdcd3c
5 changed files with 265 additions and 268 deletions

View File

@@ -317,6 +317,13 @@ router.sx (standalone — pure string/list ops)")))
"bootstrap_py.py"))
(td :class "px-3 py-2 font-mono text-sm text-stone-500" "sx_ref.py")
(td :class "px-3 py-2 text-green-600" "Live"))
(tr :class "border-b border-stone-100 bg-green-50"
(td :class "px-3 py-2 text-stone-700" "Python (self-hosting)")
(td :class "px-3 py-2 font-mono text-sm text-violet-700"
(a :href "/bootstrappers/self-hosting" :class "hover:underline"
"py.sx"))
(td :class "px-3 py-2 font-mono text-sm text-stone-500" "sx_ref.py")
(td :class "px-3 py-2 text-green-600" "G0 == G1"))
(tr :class "border-b border-stone-100"
(td :class "px-3 py-2 text-stone-700" "Rust")
(td :class "px-3 py-2 font-mono text-sm text-stone-400" "bootstrap_rs.py")
@@ -366,6 +373,72 @@ router.sx (standalone — pure string/list ops)")))
(pre :class "text-xs leading-relaxed whitespace-pre-wrap break-words"
(code (highlight bootstrapped-output "javascript"))))))))
;; ---------------------------------------------------------------------------
;; Self-hosting bootstrapper (py.sx) — live verification
;; ---------------------------------------------------------------------------
;; @css bg-green-100 text-green-800 bg-green-50 border-green-200 text-green-700
(defcomp ~bootstrapper-self-hosting-content (&key py-sx-source g0-output g1-output defines-matched defines-total g0-lines g0-bytes verification-status)
(~doc-page :title "Self-Hosting Bootstrapper (py.sx)"
(div :class "space-y-8"
(div :class "space-y-3"
(p :class "text-stone-600"
(code :class "text-violet-700 text-sm" "py.sx")
" is an SX-to-Python translator written in SX. "
"This page runs it live: loads py.sx into the evaluator, translates each spec file, "
"and diffs the result against " (code :class "text-violet-700 text-sm" "bootstrap_py.py") ".")
(div :class "rounded-lg p-4"
:class (if (= verification-status "identical")
"bg-green-50 border border-green-200"
"bg-red-50 border border-red-200")
(div :class "flex items-center gap-3"
(span :class "inline-flex items-center rounded-full px-3 py-1 text-sm font-semibold"
:class (if (= verification-status "identical")
"bg-green-100 text-green-800"
"bg-red-100 text-red-800")
(if (= verification-status "identical") "G0 == G1" "MISMATCH"))
(p :class "text-sm"
:class (if (= verification-status "identical") "text-green-700" "text-red-700")
defines-matched "/" defines-total " defines match. "
g0-lines " lines, " g0-bytes " bytes."))))
(div :class "space-y-3"
(div :class "flex items-baseline gap-3"
(h2 :class "text-2xl font-semibold text-stone-800" "py.sx Source")
(span :class "text-sm text-stone-400 font-mono" "shared/sx/ref/py.sx"))
(p :class "text-sm text-stone-500"
"The SX-to-Python translator — 55 " (code "define") " forms. "
"Name mangling (200+ RENAMES), expression emission, statement emission, "
"cell variable detection for " (code "set!") " across lambda boundaries.")
(div :class "not-prose bg-stone-100 rounded-lg p-5 max-h-96 overflow-y-auto border border-stone-200"
(pre :class "text-xs leading-relaxed whitespace-pre-wrap break-words"
(code (highlight py-sx-source "lisp")))))
(div :class "space-y-3"
(div :class "flex items-baseline gap-3"
(h2 :class "text-2xl font-semibold text-stone-800" "G0 Output")
(span :class "text-sm text-stone-400 font-mono" "bootstrap_py.py → sx_ref.py"))
(p :class "text-sm text-stone-500"
"Generated by the hand-written Python bootstrapper.")
(div :class "not-prose bg-stone-100 rounded-lg p-5 max-h-96 overflow-y-auto border border-stone-200"
(pre :class "text-xs leading-relaxed whitespace-pre-wrap break-words"
(code (highlight g0-output "python")))))
(div :class "space-y-3"
(div :class "flex items-baseline gap-3"
(h2 :class "text-2xl font-semibold text-stone-800" "G1 Output")
(span :class "text-sm text-stone-400 font-mono" "py.sx → sx_ref.py"))
(p :class "text-sm text-stone-500"
"Generated by py.sx running on the Python evaluator. "
(if (= verification-status "identical")
(strong "Byte-for-byte identical to G0.")
"Differs from G0 — see mismatch details."))
(div :class "not-prose bg-stone-100 rounded-lg p-5 max-h-96 overflow-y-auto border"
:class (if (= verification-status "identical") "border-green-200" "border-red-200")
(pre :class "text-xs leading-relaxed whitespace-pre-wrap break-words"
(code (highlight g1-output "python"))))))))
;; ---------------------------------------------------------------------------
;; Python bootstrapper detail
;; ---------------------------------------------------------------------------