Content-addressed computation: freeze → hash → CID → thaw
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled

Hash frozen SX to a content identifier (djb2 → hex). Same state
always produces the same CID. Store by CID, retrieve by CID.

- content-hash: djb2 hash of SX text → hex string
- content-put/get: in-memory content store
- freeze-to-cid: freeze scope → store → return CID
- thaw-from-cid: look up CID → thaw signals
- char-code-at / to-hex primitives for both platforms
- Live demo: counter + name widget, content-address button,
  CID display, restore from CID input, CID history

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 00:17:29 +00:00
parent 488fc53fda
commit f7debec7c6
6 changed files with 213 additions and 1 deletions

View File

@@ -1020,6 +1020,10 @@ number_p = PRIMITIVES["number?"]
string_p = PRIMITIVES["string?"]
list_p = PRIMITIVES["list?"]
dissoc = PRIMITIVES["dissoc"]
PRIMITIVES["char-code-at"] = lambda s, i: ord(s[int(i)]) if 0 <= int(i) < len(s) else 0
PRIMITIVES["to-hex"] = lambda n: hex(int(n) & 0xFFFFFFFF)[2:]
char_code_at = PRIMITIVES["char-code-at"]
to_hex = PRIMITIVES["to-hex"]
index_of = PRIMITIVES["index-of"]
lower = PRIMITIVES["lower"]
char_from_code = PRIMITIVES["char-from-code"]