Problem
With graduated directives in place, a user still has to annotate every compiler-synthesized specialization by hand. The compiler can infer them: after optimizing a binding, if it reduced to an eta-alias (a reference applied to k arguments), copy the target's policy with arity=N becoming arity=(N - k); if the binding is a synthetic dictionary specialization applied to at least its arity, mark it always-inline. A specialized instance method then inherits unconditional inlining with no annotation.
Approach
After the optimize fixpoint settles a binding, inspect its final shape. An eta-alias inherits the target's directive with the arity decremented by the applied arguments; a synthetic specialization saturated to its arity is annotated always-inline. Emit these as derived directives that feed back into the inliner, bounded so the derivation itself terminates.
Prerequisites / Relations
Blocked by #232 (the graduated @inline directives issue): there is no arity policy to propagate without it. Pairs with the default-directive pack: together they remove the need to hand-annotate both the library primitives and their compiler-generated specializations.
Verification / Measurement
A synthetic specialization of a directive-carrying combinator inlines at its saturated sites with no hand-written pragma, in an end-to-end golden; a non-saturated alias keeps the arity-decremented policy rather than inlining. Corpus size effect through #172.
Problem
With graduated directives in place, a user still has to annotate every compiler-synthesized specialization by hand. The compiler can infer them: after optimizing a binding, if it reduced to an eta-alias (a reference applied to k arguments), copy the target's policy with
arity=Nbecomingarity=(N - k); if the binding is a synthetic dictionary specialization applied to at least its arity, mark it always-inline. A specialized instance method then inherits unconditional inlining with no annotation.Approach
After the optimize fixpoint settles a binding, inspect its final shape. An eta-alias inherits the target's directive with the arity decremented by the applied arguments; a synthetic specialization saturated to its arity is annotated always-inline. Emit these as derived directives that feed back into the inliner, bounded so the derivation itself terminates.
Prerequisites / Relations
Blocked by #232 (the graduated
@inlinedirectives issue): there is no arity policy to propagate without it. Pairs with the default-directive pack: together they remove the need to hand-annotate both the library primitives and their compiler-generated specializations.Verification / Measurement
A synthetic specialization of a directive-carrying combinator inlines at its saturated sites with no hand-written pragma, in an end-to-end golden; a non-saturated alias keeps the arity-decremented policy rather than inlining. Corpus size effect through #172.