Skip to content

Built-in function naming consistency audit #288

@aallan

Description

@aallan

The v0.0.88 viability assessment identifies built-in function naming inconsistency as a source of agent hallucination errors. An audit of all ~68 built-in functions reveals four distinct naming patterns where there should ideally be one or two.

Pattern analysis

Pattern Count Examples
domain_verb (compound) ~46 (68%) string_length, array_append, regex_match, md_parse
Prefix-less ~11 (16%) abs, min, max, floor, ceil, strip, split, join
to_target ~4 (6%) to_string, to_float, to_upper, to_lower
is_predicate ~2 (3%) is_nan, is_infinite

Specific inconsistencies

  • string_contains has the string_ prefix, but starts_with, ends_with, index_of don't
  • is_nan, is_infinite lack a float_ prefix that would match float_to_int
  • to_string is a redundant alias for int_to_string
  • Math functions (abs, min, max) are prefix-less while their domain peers use prefixes
  • replace is prefix-less while string_repeat, string_slice use string_ prefix
  • strip, split, join are prefix-less string/array operations

Impact on agents

When naming follows inconsistent patterns, LLMs hallucinate function names by applying the wrong pattern (e.g., guessing string_starts_with or string_strip). A consistent naming scheme reduces these errors.

Recommendation

Audit and standardise before v0.1.0 (breaking change). The dominant pattern (68% domain_verb) should be the standard. Math functions are the acceptable exception — abs, min, max are universally understood without a math_ prefix.

Cross-references

Related to #211 (combinators will add more function names), #133 (map/fold will add more names). This audit should happen before those features ship to establish the naming convention they should follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C9C9 — Language designdesignFuture language design (spec §0.8)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions