Add TCO to evaluator, update SX docs messaging
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m3s

Evaluator: add _Thunk + _trampoline for tail-call optimization in
lambdas, components, if/when/cond/case/let/begin. All callers in
html.py, resolver.py, handlers.py, pages.py, jinja_bridge.py, and
query_registry.py unwrap thunks at non-tail positions.

SX docs: update tagline to "s-expressions for the web", rewrite intro
to reflect that SX replaces most JavaScript need, fix "What sx is not"
to acknowledge macros and TCO exist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 10:31:31 +00:00
parent a3318b4fd7
commit 5069072715
9 changed files with 131 additions and 94 deletions

View File

@@ -5,10 +5,10 @@
(h1 :class "text-5xl font-bold text-stone-900 mb-4"
(span :class "text-violet-600" "sx"))
(p :class "text-2xl text-stone-600 mb-8"
"High power tools for HTML — with s-expressions")
"s-expressions for the web")
(p :class "text-lg text-stone-500 max-w-2xl mx-auto mb-12"
"A hypermedia-driven UI engine that combines htmx's server-first philosophy "
"with React's component model. All rendered via s-expressions over the wire.")
"with React's component model. S-expressions over the wire — no HTML, no JavaScript frameworks.")
(div :class "bg-stone-50 border border-stone-200 rounded-lg p-6 text-left font-mono text-sm overflow-x-auto"
(pre :class "leading-relaxed" children))))
@@ -41,7 +41,7 @@
(div :class "flex-shrink-0 w-8 h-8 rounded-full bg-violet-100 text-violet-700 flex items-center justify-center font-bold" "1")
(div
(h3 :class "font-semibold text-stone-900" "Server renders sx")
(p :class "text-stone-600" "Python builds s-expression trees. Components, HTML elements, data — all in one format.")))
(p :class "text-stone-600" "Python builds s-expression trees. Components, elements, data — all in one format.")))
(div :class "flex items-start gap-4"
(div :class "flex-shrink-0 w-8 h-8 rounded-full bg-violet-100 text-violet-700 flex items-center justify-center font-bold" "2")
(div
@@ -60,5 +60,5 @@
(a :href "https://htmx.org" :class "text-violet-600 hover:underline" "htmx")
" by Carson Gross. This documentation site is modelled on "
(a :href "https://four.htmx.org" :class "text-violet-600 hover:underline" "four.htmx.org")
". htmx showed that HTML is the right hypermedia format. "
". htmx showed that hypermedia belongs on the server. "
"sx takes that idea and wraps it in parentheses.")))

View File

@@ -279,14 +279,15 @@ def _docs_introduction_sx() -> str:
'Components use defcomp with keyword parameters and optional children. '
'The evaluator supports let bindings, conditionals, lambda, map/filter/reduce, and ~80 primitives.")'
' (p :class "text-stone-600"'
' "sx is not trying to replace JavaScript. It\'s trying to replace the pattern of '
' "sx replaces the pattern of '
'shipping a JS framework + build step + client-side router + state management library '
'just to render some server data into HTML."))'
'just to render some server data. For most applications, sx eliminates the need for '
'JavaScript entirely — htmx attributes handle interactivity, hyperscript handles small behaviours, '
'and the server handles everything else."))'
' (~doc-section :title "What sx is not" :id "not"'
' (ul :class "space-y-2 text-stone-600"'
' (li "Not a general-purpose programming language — it\'s a UI rendering language")'
' (li "Not a Lisp implementation — no macros, no continuations, no tail-call optimization")'
' (li "Not a replacement for JavaScript — it handles rendering, not arbitrary DOM manipulation")'
' (li "Not a full Lisp — it has macros and TCO, but no continuations or call/cc")'
' (li "Not production-hardened at scale — it runs one website"))))'
)