Add TCO to evaluator, update SX docs messaging
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:
@@ -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"))))'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user