Repository navigation
-mm=own: facts from objects, fresh results, __MEMORY_MODEL__/__OS__/__ARCH__ - #686
Merged
Merged
Conversation
…_/__ARCH__ - Every own module whose object another module may link publishes __tsownfacts_<file>_<hash> (no-drops names, overwritten places, and a `fresh` field when the result is the caller's to own), whatever it exports: the default library's static lib.obj is built --export=none. - --own-facts=<obj> reads them; the static default library's are read too. Imported calls get __own_no_drops / __own_drop_fields / __own_fresh_result. - __MEMORY_MODEL__, __OS__ and __ARCH__ are compile-time string constants; a compare of one with a string literal is folded, so the branch not taken is not generated. Only those constants' ops are folded. - Tests: own-facts-objects.cmake, 00memory_model_constant.ts (all models). Spec: docs/superpowers/specs/2026-10-25-own-facts-from-objects-design.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rtalizes) (#687) - A keeper is a non-exported array global only ever pushed onto: what it holds lives to the end of the program. A value pushed into one is made immortal (ts.MakeImmortal, ts.MarkImmortalCell) where its origin is known: a bound method's object, a closure's box, cells and copies, a fresh value. - A function that pushes a parameter keeps it for good; its callers mark the argument (a fixpoint over calls). One another module may call says so with @immortalizes("p"), checked against the body and carried in declarations. - Inference treats such values as immortal; stack promotion as escaping. - Tests: own_immortal_keepers (all models), own-keepers-objects.cmake, own_err_keeper_*. Closure-escape error tests now empty their global so it is no keeper. Spec: docs/superpowers/specs/2026-10-25-own-immortal-keepers-design.md Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-mm=ownwhose object another module may link now publishes__tsownfacts_<file>_<hash>. It is a char array listing, for each function:freshfield, that its result is the caller's to own.--own-facts=<obj>reads these facts. The driver also reads them from the static default library, which is built with--export=none, so the facts no longer depend on the export marker.this.eye = transform3(this.eye, m)across modules is now accepted. A function that returns a borrow cannot be called from another module: that is already an error in its own module.__MEMORY_MODEL__,__OS__(win32/linux/android/darwin) and__ARCH__(x64/ia32/arm64/arm/wasm32) are string constants. A compare of one with a string literal is folded, so the branch not taken is never generated. Only these constants' ops are folded: folding every literal-typed compare broke 46 tests, because narrowed fields and~1carry literal types that differ from their runtime values.Spec:
docs/superpowers/specs/2026-10-25-own-facts-from-objects-design.mdTests
test-own-facts-objects: no facts → error, facts → links and prints11, an overwriting callee → error.00memory_model_constant.tsunder gc, rc, own and none (JIT and compile).🤖 Generated with Claude Code