Skip to content

selfhost: port monomorphization naming policy to Flow - #711

Merged
godofecht merged 1 commit into
mainfrom
selfhost/port-monomorph-name-core
Aug 23, 2026
Merged

godofecht merged 1 commit into
mainfrom
selfhost/port-monomorph-name-core

Conversation

@godofecht

@godofecht godofecht commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Starts #676 with an AST-independent slice from src/flow/monomorphize.py.

Ports plain specialization spelling (identity_i32, Pair_i32_f32), the 64-level instantiation-depth guard, and the policy that skips already-generated specializations or resolves concrete-name collisions without synthesizing a duplicate.

It now also ports the byte-exact compound _type_to_str wire format: P/R/C, N<len>_<name>, optional S<size>, E<encoded-element>, and T<count>_<encoded-args>, joined by __. A native decimal writer preserves multi-digit lengths and sizes. Nested element/type-argument strings are supplied already encoded, so the remaining AST adapter can recurse without changing the naming ABI.

Adds tests/lang/test_monomorphize_port.flow with plain spelling, compound pointer/reference/capability, sized element, generic-argument, multi-digit decimal, capacity, depth and collision-policy coverage.

Cross-module generic discovery, substitution maps, specialization cloning and request closure remain for subsequent #676 work.

Related: #674 #676

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant