Add provide/emit! geography article, update spreads article, fix foundations rendering
- New geography article (provide.sx): four primitives, demos, nested scoping, adapter comparison, spec explorer links - Updated spreads article section VI: provide/emit! is now implemented, not planned - Fixed foundations.sx: ~docs/code-block → ~docs/code (undefined component was causing the page to silently fail to render) - Added nav entry and defpage route for provide/emit! article Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
(p "Every layer is definable in terms of the one below. "
|
||||
"No layer can be decomposed without the layer beneath it.")
|
||||
|
||||
(~docs/code-block :code
|
||||
(~docs/code :code
|
||||
(str "Layer 0: CEK machine (expression + environment + continuation)\n"
|
||||
"Layer 1: Continuations (shift / reset \u2014 delimited capture)\n"
|
||||
"Layer 2: Algebraic effects (operations + handlers)\n"
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
(p "SX already implements CEK. It just doesn't name it:")
|
||||
|
||||
(~docs/code-block :code
|
||||
(~docs/code :code
|
||||
(str ";; eval-expr IS the CEK transition function\n"
|
||||
";; C = expr, E = env, K = implicit (call stack / trampoline)\n"
|
||||
"(define eval-expr\n"
|
||||
@@ -105,7 +105,7 @@
|
||||
(p "Delimited continuations (Felleisen 1988, Danvy & Filinski 1990) "
|
||||
"expose the K register as a first-class value:")
|
||||
|
||||
(~docs/code-block :code
|
||||
(~docs/code :code
|
||||
(str ";; reset marks a point in the continuation\n"
|
||||
"(reset\n"
|
||||
" (+ 1 (shift k ;; k = \"the rest up to reset\"\n"
|
||||
@@ -148,7 +148,7 @@
|
||||
"an operation (\"perform this effect\") and a handler (\"here's what that effect means\"). "
|
||||
"The handler receives the operation's argument and a continuation to resume the program.")
|
||||
|
||||
(~docs/code-block :code
|
||||
(~docs/code :code
|
||||
(str ";; Pseudocode \u2014 algebraic effect style\n"
|
||||
"(handle\n"
|
||||
" (fn () (+ 1 (perform :ask \"what number?\")))\n"
|
||||
@@ -317,7 +317,7 @@
|
||||
(p "The deepest primitive is not a single thing. "
|
||||
"It's a point in a three-dimensional space:")
|
||||
|
||||
(~docs/code-block :code
|
||||
(~docs/code :code
|
||||
(str "depth: CEK \u2192 continuations \u2192 algebraic effects \u2192 scoped effects\n"
|
||||
"topology: sequential \u2192 concurrent \u2192 distributed\n"
|
||||
"linearity: unrestricted \u2192 affine \u2192 linear"))
|
||||
@@ -378,7 +378,7 @@
|
||||
(p "If C, E, and K are all data structures (not host stack frames), "
|
||||
"the entire computation state is serializable:")
|
||||
|
||||
(~docs/code-block :code
|
||||
(~docs/code :code
|
||||
(str ";; Freeze a computation mid-flight\n"
|
||||
"(let ((state (capture-cek)))\n"
|
||||
" (send-to-worker state) ;; ship to another machine\n"
|
||||
@@ -454,7 +454,7 @@
|
||||
|
||||
(p "Add optional effect annotations to function definitions:")
|
||||
|
||||
(~docs/code-block :code
|
||||
(~docs/code :code
|
||||
(str ";; Declare what effects a function uses\n"
|
||||
"(define fetch-user :effects [io auth]\n"
|
||||
" (fn (id) ...))\n"
|
||||
@@ -477,7 +477,7 @@
|
||||
|
||||
(p "Refactor eval.sx to expose the CEK registers as data:")
|
||||
|
||||
(~docs/code-block :code
|
||||
(~docs/code :code
|
||||
(str ";; The CEK state is a value\n"
|
||||
"(define-record CEK\n"
|
||||
" :control expr ;; the expression\n"
|
||||
@@ -514,7 +514,7 @@
|
||||
|
||||
(p "Extend the CEK machine to support multiple concurrent computations:")
|
||||
|
||||
(~docs/code-block :code
|
||||
(~docs/code :code
|
||||
(str ";; Fork: create two CEK states from one\n"
|
||||
"(define fork :effects [concurrency]\n"
|
||||
" (fn (cek)\n"
|
||||
@@ -539,7 +539,7 @@
|
||||
|
||||
(p "Add resource-safety constraints:")
|
||||
|
||||
(~docs/code-block :code
|
||||
(~docs/code :code
|
||||
(str ";; Linear scope: must be entered, must complete\n"
|
||||
"(define-linear open-file :effects [io linear]\n"
|
||||
" (fn (path)\n"
|
||||
|
||||
Reference in New Issue
Block a user